Lecture 6 - Slide 11 : 40 |
A priority queue is a heap
top() returns the largest element in the queue
We show an example of a priority queue of points, which is built on top of double-ended queue
A priority queue relies on a comparison function - in our case the overloaded < operator in class Point
A priority queue is an adoptor of an underlying container - defaulted to vector - in the example below we use deque