@Override
    @LogarithmicTime(amortized = true)
    public Handle<K, V> deleteMin() {
        if (Constants.NOT_BENCHMARK && size == 0) {
            throw new NoSuchElementException();
        }

        ArrayHandle result = array[1];
        result.index = NO_INDEX;
        if (size == 1) {
            array[1] = null;
            size = 0;
        } else {
            array[1] = array[size--];
            if (comparator == null) {
                fixdown(1);
            } else {
                fixdownWithComparator(1);
            }
        }

        if (Constants.NOT_BENCHMARK) {
            if (2 * minCapacity < array.length - 1 && 4 * size < array.length - 1) {
                ensureCapacity((array.length - 1) / 2);
            }
        }
        return result;
    }
@ Override @ LogarithmicTime ( amortized = true ) public Handle < K , V > deleteMin ( ) { if ( Constants . NOT_BENCHMARK && size == 0 ) { throw new NoSuchElementException ( ) ; } ArrayHandle result = array [ 1 ] ; result . index = NO_INDEX ; if ( size == 1 ) { array [ 1 ] = null ; size = 0 ; } else { array [ 1 ] = array [ size -- ] ; if ( comparator == null ) { fixdown ( 1 ) ; } else { fixdownWithComparator ( 1 ) ; } } if ( Constants . NOT_BENCHMARK ) { if ( 2 * minCapacity < array . length - 1 && 4 * size < array . length - 1 ) { ensureCapacity ( ( array . length - 1 ) / 2 ) ; } } return result ; }
{@inheritDoc}