@ SuppressWarnings ( "unchecked" ) protected E removeAt ( int pos ) { if ( pos < 0 || pos >= size ) { return null ; } final E ret = ( E ) queue [ pos ] ; // Replacement object: final Object reinsert = queue [ size - 1 ] ; queue [ size - 1 ] = null ; size -- ; heapifyDown ( pos , reinsert ) ; heapModified ( ) ; return ret ; }
Remove the element at the given position .