Question: help me..................... 3' For an array A = [(11, a2, a3, a4] of distinct numbers, there are two main ways to build a heap, as
help me.....................
![help me..................... 3' For an array A = [(11, a2, a3, a4]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/6709a104d65fb_2926709a104bc83a.jpg)
3' For an array A = [(11, a2, a3, a4] of distinct numbers, there are two main ways to build a heap, as described in class. In parts (a) and (b) of this problem you must show what comparisons each method will make, in the form of a binary decision tree. Each leaf should contain output in the form of some permutation of the input subscripts in A (e.g., if you write 3124 it means that after building the heap we have A = [(13, a1, a2, a4]. (a) Do the above (draw the decision tree) for the forward method. (b) Do the above (draw the decision tree) for the reverse method. (c) Describe your own heapbuilding algorithm that specically handles inputs of size 4, and draw the corresponding decision tree that uses fewer decisions in the worstcase compared to the meth ods in (a) and (b). Your algorithm should be described in English, not pseudocode
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
