in reply to Re^3: getting the highest value in a simpler way
in thread getting the highest value in a simpler way
Insertion of each element individually is O(log n), for a plain heap. A Fibonacci heap does inserts in O(1), and get/delete-min's in O(log n) amortized time, but at the cost of being pretty tricky to implement correctly, though there are modules to help with that.
But to your point, yes, each insert is O(log n).
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: getting the highest value in a simpler way
by exussum0 (Vicar) on Nov 10, 2004 at 20:35 UTC |