int function ( int arg0 ) { int loc0 = 2 * arg0 + 1 ; int loc1 = 2 * arg0 + 2 ; if ( size <= loc1 ) { return loc0 ; } Info loc2 = map . get ( b . get ( loc0 ) ) ; Info loc3 = map . get ( b . get ( loc1 ) ) ; return ( loc2 . priority <= loc3 . priority ? loc0 : loc1 ) ; }
return the index of the smaller child of b q precondition : left child exists : 2q +1 < size of heap concode_field_sep int size concode_elem_sep Map<E,Info> map concode_elem_sep int index concode_elem_sep List<E> b concode_elem_sep double priority concode_field_sep void add concode_elem_sep int size concode_elem_sep void changePriority concode_elem_sep boolean isEmpty concode_elem_sep void bubbleUp concode_elem_sep E poll concode_elem_sep void bubbleDown concode_elem_sep E peek