II. a. Use a top-down approach to build a heap from the following array. Show the intermediate results after adding each element to the heap. Show how the heap will be stored in the array at the end. 21 17 || 1 50 65 19 90 7 10 2 12 4 70 40 b. Using the resulting heap and it is corresponding array representation from part a, show how the array would look like after the first, second and third iteration of applying heap-sort to the array.
II. a. Use a top-down approach to build a heap from the following array. Show the intermediate results after adding each element to the heap. Show how the heap will be stored in the array at the end. 21 17 || 1 50 65 19 90 7 10 2 12 4 70 40 b. Using the resulting heap and it is corresponding array representation from part a, show how the array would look like after the first, second and third iteration of applying heap-sort to the array.
Related questions
Question
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps