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


Tuesday, 11-Apr-2000 16:05:30 EDT

Sorry! We could not find what you were looking for

Try going back to the main page here

 
4
4
0
0
0
0

Sorry! We could not find what you were looking for

Try going back to the main page here

 
4
4
0
0
0
0