docs: public static final void removeMin(long[] heapKeys, double[] heapValues, int heapSize) {
      heapValues[0] = heapValues[heapSize - 1];
      heapKeys[0] = heapKeys[heapSize - 1];
  
      int curIndex = 0;
      int leftIndex, rightIndex, minIndex;
      boolean done = false;
      while (!done) {
        done = true;
        leftIndex = 1 + (curIndex * 2);
        rightIndex = leftIndex + 1;
  
        minIndex = -1;
        if (rightIndex < heapSize) {
          minIndex = heapValues[leftIndex] <= heapValues[rightIndex] ? leftIndex : rightIndex;
        } else if (leftIndex < heapSize) {
          minIndex = leftIndex;
        }
  
        if (minIndex != -1 && heapValues[minIndex] < heapValues[curIndex]) {
          swap(heapKeys, heapValues, curIndex, minIndex);
          done = false;
          curIndex = minIndex;
        }
      }
    }