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