Question: What is min-heap? Explain O(log n) time algorithm for inserting an element, extracting minimum element from a min-heap with n elements. Using the above operations
What is min-heap? Explain O(log n) time algorithm for inserting an element, extracting minimum element from a min-heap with n elements. Using the above operations give O(n log n) time algorithm to sort an array of n numbers. ( you are only allowed to use O(1) extra space). Can you build a min-heap of n elements in O(n) time? If yes give brief analysis supporting your claim.
Step by Step Solution
3.46 Rating (156 Votes )
There are 3 Steps involved in it
A minheap is a complete binary tree or binary heap where each parent node is less than or equal to its child nodes This property ensures that the mini... View full answer
Get step-by-step solutions from verified subject matter experts
