Question: Problem 3 Consider the problem of sorting an array of integers using the heapsort algorithm. Assume that Answer the following questions. (1) Heapsort consists of

Problem 3 Consider the problem of sorting an array of integers using the heapsort algorithm. Assume that Answer the following questions. (1) Heapsort consists of two phases. Explain what is to be performed in each phase (2) Consider sorting of the following array using heapsort. heapsort brings the minimum element to the front (3,8, 1,5, 4,9,7) Draw the tree structure of the heap just after the first phase (3) Answer the time complexity of each phase when sorting an array of length n. Explain the (4) Answer the time complexity of obtaining a sorted list of the smallest k elements from an (5) The execution time of heapsort on modern computer systems is often longer than that of some reasoin array of length n using heapsort. Explain the reason other sort algorithms such as quicksort and mergesort when sorting a large array. Explain a possible reason
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
