moveDown_(index) {
    const nodes = this.nodes_;
    const count = nodes.length;

    // Save the node being moved down.
    const node = nodes[index];
    // While the current node has a child.
    while (index < (count >> 1)) {
      const leftChildIndex = this.getLeftChildIndex_(index);
      const rightChildIndex = this.getRightChildIndex_(index);

      // Determine the index of the smaller child.
      const smallerChildIndex = rightChildIndex < count &&
              nodes[rightChildIndex].getKey() < nodes[leftChildIndex].getKey() ?
          rightChildIndex :
          leftChildIndex;

      // If the node being moved down is smaller than its children, the node
      // has found the correct index it should be at.
      if (nodes[smallerChildIndex].getKey() > node.getKey()) {
        break;
      }

      // If not, then take the smaller child as the current node.
      nodes[index] = nodes[smallerChildIndex];
      index = smallerChildIndex;
    }
    nodes[index] = node;
  }
Moves the node at the given index down to its proper place in the heap.
@param {number} index The index of the node to move down.
@private