PQ Implementationwith Heaps
Keep the pairs in the nodes of a partially ordered binary tree called a heap.
Insertion: O(log n)
For DeleteMin, remove the root of the heap, then update it to maintain the heap property: O(log n).
Previous slide
Next slide
Back to first slide
View graphic version