function siftDown(compare, heap, startIndex, i) {
  var item = heap[i],
      parentIndex,
      parent;

  while (i > startIndex) {
    parentIndex = (i - 1) >> 1;
    parent = heap[parentIndex];

    if (compare(item, parent) < 0) {
      heap[i] = parent;
      i = parentIndex;
      continue;
    }

    break;
  }

  heap[i] = item;
}
Function used to sift down.

@param {function} compare    - Comparison function.
@param {array}    heap       - Array storing the heap's data.
@param {number}   startIndex - Starting index.
@param {number}   i          - Index.