code: public static void siftUp(int[] arr, int k) {
          while (k > 1 && arr[k/2] < arr[k]) {
              swap(arr, k, k/2);
              k = k/2;
          }
      }
docs: To restore the max-heap condition when a node's priority is increased.
  We move up the heap, exchaning the node at position k with its parent
  (at postion k/2) if necessary, continuing as long as a[k/2] &lt; a[k] or
  until we reach the top of the heap.