![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Templates and The Standard Library - slide 25 : 39 |
A priority queue is a heap
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 adapts an underlying container, defaulted to vector - we try a deque instead.
![]() | The implementation of class Point and in particular operator<. |
![]() | Illustration of priority_queue<Point, deque<Point> >. |