function pushpop(compare, heap, item) {
  var tmp;

  if (heap.length !== 0 && compare(heap[0], item) < 0) {
    tmp = heap[0];
    heap[0] = item;
    item = tmp;
    siftUp(compare, heap, 0);
  }

  return item;
}
Function used to push an item in the heap then pop the heap and return the
popped value.

@param  {function} compare - Comparison function.
@param  {array}    heap    - Array storing the heap's data.
@param  {any}      item    - The item to push.
@return {any}