PQ - deleteMin  ( )

Remove min element (the root)

The delete operation must maintain


from text:

template <class Comparable> void BinaryHeap<Comparable>:: deleteMin ( Comparable & minItem ) { if ( isEmpty ( ) ) throw UnderFlow ( ); minItem = array [ 1 ]; array [ 1 ] = array [ currentSize-- ]; percolateDown ( 1 ); }

percolateDown (i) just moves the element at index i to it's right spot
swapping with the smallest child