Question: 1. Consider an array of size nine with the numbers in the following order 80,60, 40, 20, 90, 50, 10, 70, 30. (a) Form the

 1. Consider an array of size nine with the numbers in

1. Consider an array of size nine with the numbers in the following order 80,60, 40, 20, 90, 50, 10, 70, 30. (a) Form the heap using the algorithm described in the lecture. Show the heap as a tree. Show the heap as an array. Exactly how many comparisons did heap creation use? (b) Finish heapsort: Start with the heap created in Part (a). Show the array after each element sifts down after heap creation. How many comparisons does each sift use? What is the total number of comparisons after heap creation

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!