Question: Rewrite the mergeSort method to recursively sort the first half of the array and the second half of the array without creating new temporary arrays,
Rewrite the mergeSort method to recursively sort the first half of the array and the second half of the array without creating new temporary arrays, and then merge the two into a temporary array and copy its contents to the original array, as shown in Figure 23.6b.

Original list Divide Sort first half of the original array Sort second half of the original array Recursively sort Merge New sorted temporary list Copy this to the original list (b)
Step by Step Solution
3.29 Rating (164 Votes )
There are 3 Steps involved in it
Program Plan Create a new class RecursiveMergeSort Create a static method mergeArray mergeArray meth... View full answer
Get step-by-step solutions from verified subject matter experts
