private static int heapDelete ( int [ ] heap , int [ ] reverseIndex , int count , int heapIndex , float [ ] values ) { int end = count - 1 ; reverseIndex [ heap [ heapIndex ] ] = - 1 ; heap [ heapIndex ] = heap [ end ] ; reverseIndex [ heap [ heapIndex ] ] = heapIndex ; end -- ; siftDown ( heap , reverseIndex , heapIndex , end , values ) ; return count - 1 ; }
Deletes an item from the min - heap and updates the reverse index