Question: PROBLEM 1 Given the following array: {24, 3, 27, 13, 34, 2, 50, 12} If the array were sorted using the version of mergesort presented

PROBLEM 1

Given the following array:

{24, 3, 27, 13, 34, 2, 50, 12} 

If the array were sorted using the version of mergesort presented in lecture, what would the array look like after the completion of the second call to the merge() methodthe method that merges two subarrays? Note: The merge method is the separate helper method; is not the recursive mSort method.

1. What would the array look like after the completion of the fourth call to the merge()method?

2. The initial call to the recursive mSort() method is made from within the mergeSort()wrapper method. This initial call to mSort() is not a recursive call, because the method is not calling itself. Rather, all recursivecalls to mSort() are made from within mSort().

3. Assuming that the array has at least two elements, the initial invocation of mSort()makes two recursive calls (which in turn lead to other recursive calls, and so on). Starting with the initial array above, what would the array look like after the completion of the firstof these two recursive calls?

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