Added priority queue implementation based on heap.