code: public static final <T> void offer(T[] heapKeys, double[] heapValues, int heapSize,
        T newKey, double newValue) {
      heapKeys[heapSize] = newKey;
      heapValues[heapSize] = newValue;
  
      int curIndex = heapSize;
      int parentIndex = (curIndex - 1) / 2;
      while (heapValues[curIndex] < heapValues[parentIndex]) {
        swap(heapKeys, heapValues, curIndex, parentIndex);
        curIndex = parentIndex;
        // Note that if curIndex = 0, parentIndex = curIndex so the loop test
        // will become false.
        parentIndex = (curIndex - 1) / 2;
      }
    }
docs: Adds {@code newKey} with value {@code newValue} to the heap represented by
  {@code heapKeys} and {@code heapValues}. {@code heapSize} is the current
  size of the heap; after calling this method, the heap's size will grow by
  1.
  
  @param heapKeys
  @param heapValues
  @param heapSize
  @param newKey
  @param newValue