Question: You are provided with the following unsorted int-typed array: int heap [5] [9. 1, 7, 11, 3); Transform heap[] into an array-based max heap
![You are provided with the following unsorted int-typed array: int heap [5]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/650a75aedb633_1695184300273.jpg)
You are provided with the following unsorted int-typed array: int heap [5] [9. 1, 7, 11, 3); Transform heap[] into an array-based max heap based on Shaffer's Heapsort algorithm. Each time the current subheap rooted at i is created, provide an updated array diagram. You are not required to draw the binary heap as a graph, but it may be helpful to do so. You only need to iterate through this for loop two (2) times Show all comparisons between elements necessary to perform this process. (4 points) Heapsort Part 2 - Sort Array Using Heapsort Once heap[ ] has been transformed into a max heap, trace through Shaffer's heapsort() function to sort the array, providing an updated array diagram after each call to removeFirst(). It may help to group array diagrams by the current value being sorted, as was performed during lecture. Again, you are not required to draw the binary heap as a graph, but it may be helpful to do so. Show all comparisons between elements necessary to sort heap[ ].
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
