Recursive Implementation

  • Implement the MergeSort recursively.

Exercise Open the starter code, the Demo.java file and complete the implementation of mergesort. Assume the merge method is correctly implemented, and implement mergesort recursively.

Hint: The merge sort is naturally recursive:

  • Split the sequence into two subsequences (of roughly equal size).
  • Sort each subsequence recursively.
  • Merge the two (sorted) sub-sequences back together.
Solution

Please visit the posted solution.