Priority_queue
Basic operation:
Empty () returns true if the queue is null
Pop () Delete the top element, delete the first element
Push () joins an element
Size () returns the number of elements owned in the priority queue
Top () returns the top element of the priority queue, returning the element with the highest priority in the priority queues ( #队列中为front () )
Back () returns the priority queue-tail element, returning the element with the lowest priority in the priority queue
In the default priority queue, high priority first-out team. In the default int type, the first team is the larger number.
Priority_queue<vector<int>, less<int> > pq1; Sorting using incrementing less<int> function objects
Priority_queue<deque<int>, greater<int> > pq2; Sorting by using the Decrement greater<int> function object
Declaration method: 1, common Method 2, custom priority 3, Structure declaration method
Header files: #include <queue> #include <functional>
Reference Blog: c++stl--priority queue, "original" Priority queue Priority_queue detailed
Graph Theory _ Topology Sequencing _ Exercise 1 (priority queue small top heap)