Question: 1. Consider the following integers in an unsorted array A - [4,1,3,2,16,9,17,10,14,8,7]. Con- struct a max-heap using the two methods mentioned in the lecture notes:

1. Consider the following integers in an unsorted array A - [4,1,3,2,16,9,17,10,14,8,7]. Con- struct a max-heap using the two methods mentioned in the lecture notes: (i) iterations of Upward heapify, where n is the size of the array: for i = 1 to n-1 Upward_heapify (A, i) (ii) iterations of Downward heapify: for i = n/2-1 downto 0 Downward_heapify(A, i, n - 1)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
