Insert

Now we'll look at putting a new element into the heap.

Where should it go?

How do we restore the heap property?

Running time?

We can use insert repeatedly to build a heap from a set of n elements. What recurrence do we get for the running time? How does the running time of this compare to that of build-heap?


next up previous
Next: Heap Sort Up: HEAPS Previous: Extract Min