Question: 1. (Basic) You're given an array A1.8(3, 1,6, 8,4,2,5,7). Is this a max-heap? If not, make it a max-heap by iteratively applying the Max-Heapify function.

 1. (Basic) You're given an array A1.8(3, 1,6, 8,4,2,5,7). Is this

1. (Basic) You're given an array A1.8(3, 1,6, 8,4,2,5,7). Is this a max-heap? If not, make it a max-heap by iteratively applying the Max-Heapify function. In other words 2. (Basic) Illustrate the operation of Max-Heap-Insert(A, 9) on the heap you obtained in 3. (Basic) Ilustrate the operation of Heap-Sort on the max-heap you've obtained in problem illustrate the operation of Build-Max-Heap on the array, what is All-.g at the end? problem 1 2. Note that you don't need to execute line 1 of Heap-Sort, as you already have a max-heap 4. (Basic) You're given an array All . . . 8-(3, 1,6, 8, 4,2, 5,7). Is this a min-heap? If not, make it a min-heap by iteratively applying the Min-Heapify function 5. (Basic) Is an array that is sorted in increasing order a min-heap? 6, (Basic) Is Heap-Sort an in-place sorting algorithm? We say that a sorting algorithm is in- place if only O(1) elements are stored outside the input array at any time -in other words at most O (1) extra memory is used in the whole process. Do you see why Insertion-Sort is in-place but Merge-Sort is not? 7. (Intermediate) Give a pseudo-code to test if a given binary heap is a max-heap or not. 8. (Intermediate) We want to show that it takes O(n) time to build a max-heap. Towards this end, we will take the following steps (a) Suppose the binary heap has height H. Explain that 2H

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!