code: public void insert(int n) {
      this.indices.growTo(n + 1, -1);
      assert !this.inHeap(n);
      this.indices.set(n, this.heap.size());
      this.heap.push(n);
      this.percolateUp(this.indices.get(n));
    }
docs: Inserts a given element in the heap.
  @param n the element