PQ - deleteMin ( )
Remove min element (the root)
The delete operation must maintain
-
Heap Shape (the Complete Binary Tree property)
replace root with last vertex in the array
-
Heap Order (partial ordering)
the new value at the root will be out of place
continually exchange it with smaller child until no child is smaller
("shift down" or "percolate down")
from text:
percolateDown (i) just moves the element at index i to it's right spot
swapping with the smallest child