private void swapHeapValues ( int i , int j ) { if ( fastValueRemove == Mode . HASH ) { valueIndexMap . put ( heap [ i ] , j ) ; valueIndexMap . put ( heap [ j ] , i ) ; } else if ( fastValueRemove == Mode . BOUNDED ) { //Already in the array, so just need to set valueIndexStore [ heap [ i ] ] = j ; valueIndexStore [ heap [ j ] ] = i ; } int tmp = heap [ i ] ; heap [ i ] = heap [ j ] ; heap [ j ] = tmp ; }
Swaps the values stored in the heap for the given indices