void pushconst object )const object topconstvoid pop)bool empty)void clear)push adds to the priority queuetop returns the largest element in the priority queueand pop removes the largest element from the priority queue duplicates are allowedif there are several largest elementsonly one of them is removed the priority queue template is instantiated with an item typethe container type (almost always you would want to use vector that stores the items)and the comparatordefaults are allowed for the last two parametersand the defaults yield max-heap using greater function object as the comparator yields min-heap figure shows test program that illustrates how the priority_queue class template can be used as both the default max-heap and min-heap summary in this we have seen various implementations and uses of the priority queue adt the standard binary heap implementation is elegant because of its simplicity and speed it requires no links and only constant amount of extra spaceyet supports the priority queue operations efficiently we considered the additional merge operation and developed three implementationseach of which is unique in its own way the leftist heap is wonderful example of the power of recursion the skew heap represents remarkable data structure because of the lack of balance criteria its analysiswhich we will perform in is interesting in its own right the binomial queue shows how simple idea can be used to achieve good time bound we have also seen several uses of priority queuesranging from operating systems scheduling to simulation we will see their use again in and exercises can both insert and findmin be implemented in constant time show the result of inserting and one at timeinto an initially empty binary heap show the result of using the linear-time algorithm to build binary heap using the same input show the result of performing three deletemin operations in the heap of the previous exercise complete binary tree of elements uses array positions to suppose we try to use an array representation of binary tree that is not complete determine how large the array must be for the following