void quickRemove ( int i ) { assert i <= size ; queue [ i ] = queue [ size ] ; queue [ size -- ] = null ; // Drop extra ref to prevent memory leak }
Removes the ith element from queue without regard for maintaining the heap invariant . Recall that queue is one - based so 1 < = i < = size .