public Key delMin() {
        if (isEmpty())
            throw new java.util.NoSuchElementException();
        Key min = pq[1];
        exch(1, N--);
        sink(1);
        pq[N + 1] = null;
        if (N == pq.length / 4)
            resize(pq.length / 2);
        return min;
    }