you will implement divide and conquer algorithms: merge sort . For merge sort, you will just implement
Question:
you will implement divide and conquer algorithms: merge sort . For merge sort, you will just implement the algorithm on an array of ints. I have provided the pseudo code for algorithms. You will need to handle cases of all sizes, not just powers of 2.
Implement Merge Sort
Create a class called MergeSorter in the divideandconquer package. This class will implement merge sort on an array of ints. Implement the following method with the exact signature below. You will need to create private helper methods that do most of the work.
public static void mergeSort(int[] arr)
This method sorts the int[] arr using the merge sort algorithm described in the pseudocode above.
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest