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]

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!