Question: Problem 3 [20pts]. Design algorithm! Critical thinking. Given an array representation of min-heap, convert it to max-heap. You dont have to code it (although it
Problem 3 [20pts]. Design algorithm! Critical thinking.
Given an array representation of min-heap, convert it to max-heap. You dont have to code it (although it is a good practice) but need to explain in detail your proposed algorithm.
Analyze the running time complexity of your solution (and always think - can you do better?)![Problem 3 [20pts]. Design algorithm! Critical thinking. Given an array representation of](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66e31202d4e31_31466e312026c166.jpg)
Example input: a.cu = [3 5 7 6 8 20 10 12 189] 7 6 8 20 10 1 12 189 output: acrn = [20 18 10 12 9 7 3 5 6 8] OR any max-heap formed from input elements] 20 18 10 12 2.23 5 6 8 Important note: do not overthink this problem. All you are asked to do is build a max-heap
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
