Heap - Core Man Updated
Heap - Core Man Updated
Lecture : Heap
By
Mukesh Sharma
Asst. Professor,
Lovely Professional University, Punjab
Contents
• Introduction
• Heap Sort
• Heap Sort Complexity
• Review Questions
Introduction
• A binary heap is a complete binary tree in
which every node satisfies the heap property
which states that:
• If B is a child of A, then key(A) ≥ key(B)
insert(array, 3);
insert(array, 4);
insert(array, 9);
insert(array, 5);
insert(array, 2);
deleteRoot(array, 4);
printArray(array, size);
}
Heap Sort
Complexity of Heap Sort
Average and Worst case Complexity of Heap sort = O(nlogn).
Questions