Update appNew update is available. Click here to update.

Heap and Priority Queue

They are the built-in form of a tree, which stores all the elements in a particular order. There are majorly two types of Heaps or priority queues that came into action: Min-Heap: Elements are stored in such a way that the minimum element will always be on the top. Max-Heap: Elements are stored in such a way that the maximum element will always be on the top. The time complexity of push and pop operations in heaps and priority queues is O(log(N)) and it requires O(N) space.
puzzle icon

Top Problems related to Heap and Priority Queue