T function ( ) { if ( size > 0 ) { T loc0 = heap [ 1 ] ; heap [ 1 ] = heap [ size ] ; heap [ size ] = null ; size -- ; downHeap ( ) ; return loc0 ; } else return null ; }
removes and returns the least element of the priorityqueue in log size time . concode_field_sep int size concode_elem_sep int maxSize concode_elem_sep T[] heap concode_field_sep T top concode_elem_sep int size concode_elem_sep void upHeap concode_elem_sep void downHeap concode_elem_sep boolean lessThan concode_elem_sep void clear concode_elem_sep boolean insert concode_elem_sep void initialize concode_elem_sep void put concode_elem_sep void adjustTop