Applications of Heaps

Related Links:



Binary Heap

A Binary Heap is a complete Binary Tree which is used to store data efficiently to get the max or min element based on its structure.

A Binary Heap is either Min Heap or Max Heap. In a Min Binary Heap, the key at the root must be minimum among all keys present in Binary Heap. The same property must be recursively true for all nodes in Binary Tree. Max Binary Heap is similar to MinHeap. 

Examples of Min Heap:

            10                       10
         /      \                 /         \  
     20     100        15           30  
   /                        /    \         /    \
30                     40   50   100   40

Similar Reads

How is Binary Heap represented?

A Binary Heap is a Complete Binary Tree. A binary heap is typically represented as an array....

Operations on Heap:

Below are some standard operations on min heap:...

Applications of Heaps:

...