void function ( float [ ] arg0 , int arg1 , int arg2 ) { while ( 2 * arg1 <= arg2 ) { int loc0 = 2 * arg1 ; if ( loc0 < arg2 && arg0 [ loc0 ] < arg0 [ loc0 + 1 ] ) { loc0 ++ ; } if ( arg0 [ arg1 ] >= arg0 [ loc0 ] ) { break ; } swap ( arg0 , arg1 , loc0 ) ; arg1 = loc0 ; } }
to restore the max-heap condition when a node 's priority is decreased . we move down the heap , exchanging the node at position k with the larger of that node 's two children if necessary and stopping when the node at k is not smaller than either child or the bottom is reached . note that if n is even and k is n/2 , then the node at k has only one child -- this case must be treated properly . concode_field_sep PlaceHolder placeHolder concode_field_sep void swap concode_elem_sep void swap concode_elem_sep void swap concode_elem_sep void swap concode_elem_sep void siftUp concode_elem_sep void siftUp concode_elem_sep void siftUp concode_elem_sep void siftUp