Based on heap property there are two types of heap :
How is Binary Heap represented?
Use it whenever you need quick access to the largest (or smallest) element , because that element will always be the first element in the array or at the root of the tree. So it's a good way to deal with incoming events or data where access to the smallest/largest are always required. That's why Priority Queues can be efficiently implemented using Binary Heap because it supports insert, delete and extract_max, decrease_Key operations in O(log n) time.
Heap Applications : Heap Sort, Priority Queue, Huffman Coding, Dijkstra Algorithms, Prims Algorithms, Selection Algorithms, Order statistics etc.
| # | Title | Difficulty | Companies |
|---|---|---|---|
1. | Heap Structure, Properties and Array Implementation | ||
2. | Heap Operations : Heapify, Insertion, Deletion, Increase-key | ||
3. | Heap Building and Heap Sort | ||
4. | Example 1 : Find kth largest element in an array | MEDIUM | Google Amazon Facebook |
5. | Example 2 : Top k Frequent Elements | MEDIUM | Amazon Ebay Uber |
6. | Priority Queue and its Properties | ||
7. | Priority Queue Implementation : Array, Linked-list, BST and Heap | ||
8. | Applications of Priority Queue |