In: Computer Science
Given an array A that contains the following elements in this order 45, 2, 18, 7, 23, 47, 3, 15, 32:
(a) Build a min-heap using the bottom-up (reverse) method, showing your work. How many comparisons do you make?
(b) Build a min-heap using the top-down (forward) method, showing your work. How many comparisons do you make?
(c) Are the two heaps that you get identical? Is this a coincidence of this particular instance? Or would the same happen for other instances? Explain in your own words whether the two methods will in general produce identical heaps or not.
both trees are identical same and number of swaps are equal
I am mentioning producer in option C
Anything doubtful or not understand just comment
I will touch with you
Don't be dislike
Thank you and all the best