What is min-heap? Explain O(log n) time algorithm for inserting an element, extracting minimum element from a
Fantastic news! We've Found the answer you've been seeking!
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 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.
Related Book For
Discrete Mathematics and Its Applications
ISBN: 978-0073383095
7th edition
Authors: Kenneth H. Rosen
Posted Date: