Priority queue implemented using a heap.