Question: The operation HEAP-DELETE (A, i) deletes the item in node i from heap A. Give an implementation of HEAP-DELETE that runs in O(lg n) time
The operation HEAP-DELETE (A, i) deletes the item in node i from heap A. Give an implementation of HEAP-DELETE that runs in O(lg n) time for an n-element max-heap.
Step by Step Solution
3.29 Rating (158 Votes )
There are 3 Steps involved in it
process of deletion of element at index i in max heap 1replace the element at index i with last element 2 reduce size of arrayheap by 1 3 replaced ele... View full answer
Get step-by-step solutions from verified subject matter experts
