Heaps



Overview



What is a Heap?



Terminology



Array Storage of Trees



Heap Property



Maintaining a Heap



More on Heapfiy



How to Create a Heap from an Array?



Two Approaches to Building a Heap



Correctness of Build-Heap



Performance



HeapSort Algorithm



Code for HeapSort



Analysis of Heap Sort



Heap Implementation of Priority Ques



Priority Queue



Operation: Maximum



Operation: Extract Maximum Element



Increase Key Value



Insert into the heap