remove() {
    const nodes = this.nodes_;
    const count = nodes.length;
    const rootNode = nodes[0];
    if (count <= 0) {
      return undefined;
    } else if (count == 1) {
      nodes.length = 0;
    } else {
      nodes[0] = nodes.pop();
      this.moveDown_(0);
    }
    return rootNode.getValue();
  }
Retrieves and removes the root value of this heap.
@return {V} The value removed from the root of the heap.  Returns
    undefined if the heap is empty.