priority queues (heaps#include #include #include #include #include using namespace std/empty the priority queue and print its contents template void dumpcontentsconst string msgpriorityqueue pq cout <msg <":<endlwhile!pq emptycout <pq top<endlpq pop)/do some inserts and removes (done in dumpcontentsint mainpriority_queue maxpqpriority_queue,greaterminpqminpq push )minpq push )minpq push )maxpq push )maxpq push )maxpq push )dumpcontents"minpq"minpq )dumpcontents"maxpq"maxpq )/ / return figure routine that demonstrates the stl priority_queuethe comment shows the expected order of output priority queues in the standard library the binary heap is implemented in the stl by the class template named priority_queue found in the standard header file queue the stl implements max-heap rather than minheap so the largest rather than smallest item is the one that is accessed the key member functions are