Question: Consider the array [19, 7, 9, 24, 20, 17, 23, 15, 30]. a) Draw the corresponding complete binary tree. ( b) Heapify the tree produced
Consider the array [19, 7, 9, 24, 20, 17, 23, 15, 30].
a) Draw the corresponding complete binary tree.
( b) Heapify the tree produced in (a) into a maximum heap. Your solution should detail each call to adjust() and each swap as the tree is "heapified"(i.e., showing the tree after each call).
(c) Now insert 28 into your heapified tree produced at (b). Detail the swaps as it bubbles up into its correct position (show the swaps on the tree only).
(d) If you now removed 7 from the heapified tree produced at (b), state what steps would you have to now take.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
