Question: 4 a ) Use merge sort to sort 6 , 5 , 1 7 , 1 5 , 1 6 , 2 0 , 1

4 a) Use merge sort to sort 6,5,17,15,16,20,18,7 into increasing order. Show all the steps in the algorithm (draw the trees as shown in class)(Binary Trees).
b) What is the number of comparisons used in the merge algorithm shown in class to merge the two lists: 5,6,7,12,15; and 1,2,9,14,16.
c) In the merge algorithm, two lists in increasing order are merged into one (longer) list of increasing order. Suppose two (sorted) lists are merged, one has 5 elements, the other has 6. What is the least possible number of comparisons, and when does that occur? What is the maximum possible number of comparisons?
4 a ) Use merge sort to sort 6 , 5 , 1 7 , 1 5 ,

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 Programming Questions!