Generic binary heap.