@@ -0,0 +1,1379 @@
+package Sorting;%0A%0Aimport java.util.Arrays;%0A%0A/**%0A * Created by matao on 8/14/16.%0A */%0Apublic class MergeSort extends BaseSort %7B%0A%0A    @Override%0A    public void sort(Comparable%5B%5D a) %7B%0A        sort(a, 0, a.length - 1);%0A    %7D%0A%0A    public void sort(Comparable%5B%5D a, int low, int high) %7B%0A        if (high %3C= low) %7B%0A            return;%0A        %7D%0A        int mid = low + (high - low) / 2;%0A        sort(a, low, mid);%0A        sort(a, mid + 1, high);%0A        merge(a, low, mid, high);%0A    %7D%0A%0A    private void merge(Comparable%5B%5D a, int low, int mid, int high) %7B%0A        Comparable%5B%5D auxiliary = Arrays.copyOf(a, a.length);%0A        int i = low, j = mid + 1;%0A        int k = low;%0A        while (i %3C= mid && j %3C= high) %7B%0A            if (lessThan(auxiliary%5Bi%5D, auxiliary%5Bj%5D)) %7B%0A                a%5Bk++%5D = auxiliary%5Bi++%5D;%0A            %7D else %7B%0A                a%5Bk++%5D = auxiliary%5Bj++%5D;%0A            %7D%0A        %7D%0A%0A        while (i %3C= mid) %7B%0A            a%5Bk++%5D = auxiliary%5Bi++%5D;%0A        %7D%0A%0A        while (j %3C= high) %7B%0A            a%5Bk++%5D = auxiliary%5Bj++%5D;%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        MergeSort mergeSort = new MergeSort();%0A%0A        Integer%5B%5D a = %7B2, 1, 5, 7, 0, 10%7D;%0A        mergeSort.sort(a);%0A        System.out.println(Arrays.toString(a));%0A%0A        Integer%5B%5D b = %7B1, 1, 0, 3, -1%7D;%0A        mergeSort.sort(b);%0A        System.out.println(Arrays.toString(b));%0A    %7D%0A%7D%0A

Add merge sort