delete a minimal key and return its associated index . concode_field_sep int[] pq concode_elem_sep int NMAX concode_elem_sep Key[] keys concode_elem_sep IndexMinPQ<Key> copy concode_elem_sep int N concode_elem_sep int[] qp concode_field_sep Integer next concode_elem_sep Key keyOf concode_elem_sep void sink concode_elem_sep void change concode_elem_sep boolean isEmpty concode_elem_sep void insert concode_elem_sep void decreaseKey concode_elem_sep void increaseKey concode_elem_sep boolean hasNext concode_elem_sep void main concode_elem_sep void delete concode_elem_sep void remove concode_elem_sep boolean contains concode_elem_sep void changeKey concode_elem_sep Iterator<Integer> iterator concode_elem_sep int size concode_elem_sep Key minKey concode_elem_sep void exch concode_elem_sep int minIndex concode_elem_sep boolean greater concode_elem_sep void swim
int function ( ) { if ( N == 0 ) throw new NoSuchElementException ( "srini_string" ) ; int loc0 = pq [ 1 ] ; exch ( 1 , N -- ) ; sink ( 1 ) ; qp [ loc0 ] = - 1 ; keys [ pq [ N + 1 ] ] = null ; pq [ N + 1 ] = - 1 ; return loc0 ; }