Question: Q1 and Q2 I will give a like dont copy someone's answer to me 1. (Adapted from section 6.1) For each of the following arrays,
1. (Adapted from section 6.1) For each of the following arrays, could the array represent a min heap? If no, explain why not. a. A=[2,15,2,1,6,5,20,20] b. B=[4,5,7,18,5,15] C. C=[1,8,14,19,15,12,15] d. D=[42,42,42,42,42,42,42,42,42,42] 2. (Adapted from exercise 6.4-3) a. Show the operation of Heapsort on the array [7,6,5,4,3,2,1]. You should show the array resulting from the call to Build-MaxHeap, and the array after each call to MaxHeapify within the for loop of Heapsort. You must underline all elements in the array that are currently in the heap at each step. b. What is the asymptotic runtime for Heapsort on an array where every element is the same? Justify your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
