A priority queue is an Abstract Data Type (ADT) that operates similar to a normal queue except that each element has a certain priority. The priority of the elements in the priority queue determine the order in which elements are removed from the PQ.
Time Complexity of PQ with Binary Heap
Binary Heap Construction: O(n)
Polling: O(log n)
Peeking: O(1)
Adding: O(log n)
Converting Min PQ to Max PQ
Lexicographic Order:
1.
Negate all nodes
2.
Add
3.
negate again




