code: private void percolateUp(int pos) {
      int x = this.heap.get(pos);
      int p = parent(pos);
      int j = pos;
      while (j != 0 && this.s.lt(x, this.heap.get(p))) {
        this.heap.set(j, this.heap.get(p));
        this.indices.set(this.heap.get(p), j);
        j = p;
        p = parent(p);
      }
      this.heap.set(j, x);
      this.indices.set(x, j);
    }
docs: Bubbles a element at a given position up.
  @param pos the position