index.js
function buildHeapFromNodeArray(heap, nodeArray) {
  heap.list = nodeArray;
  for (var i = Math.floor(heap.list.length / 2); i >= 0; i--) {
    heapify(heap, i);
  }
}
function buildHeapFromNodeArray(heap, nodeArray) {
  heap.list = nodeArray;
  for (var i = Math.floor(heap.list.length / 2); i >= 0; i--) {
    heapify(heap, i);
  }
}
function buildHeapFromNodeArray ( heap , nodeArray ) { heap . list = nodeArray ; for ( var i = Math . floor ( heap . list . length / 2 ) ; i >= 0 ; i -- ) { heapify ( heap , i ) ; } }
Builds a heap from a node array, this will discard the heap's current data.

@private
@param {BinaryHeap} heap The heap to override.
@param {Node[]} nodeArray The array of nodes for the new heap.
Builds a heap from a node array this will discard the heap s current data .