In practice, "quickly" often means in logarithmic time (O(log n)). A heap can be used to implement a priority queue. FastPriorityQueue is an attempt to implement a performance-oriented priority queue ...