@@ -0,0 +1,1147 @@
+public class MergeSort %7B%0A    // Merge Sort%0A    public void mergeSort(int%5B%5D arr, int l, int r) %7B%0A        if (l %3C r) %7B%0A            int mid = l + (r - l) / 2;%0A            mergeSort(arr, l, mid);%0A            mergeSort(arr, mid+1, r);%0A            merge(arr, l, mid, r);%0A        %7D%0A    %7D%0A%0A    private void merge(int%5B%5D arr, int l, int m, int r) %7B%0A        int p = l, q = m + 1, k = 0;%0A        int%5B%5D sort = new int%5Br - l + 1%5D;%0A        for (int i = l; i %3C= r; i++) %7B%0A            if (p %3E m) %7B%0A                sort%5Bk++%5D = arr%5Bq++%5D;%0A            %7D else if (q %3E r) %7B%0A                sort%5Bk++%5D = arr%5Bp++%5D;%0A            %7D else if (arr%5Bp%5D %3C arr%5Bq%5D) %7B%0A                sort%5Bk++%5D = arr%5Bp++%5D;%0A            %7D else %7B%0A                sort%5Bk++%5D = arr%5Bq++%5D;%0A            %7D%0A        %7D%0A        for (int i = 0; i %3C k; i++) %7B%0A            arr%5Bl++%5D = sort%5Bi%5D;%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        int%5B%5D arr = new int%5B%5D%7B2, 4, 1, 9, 12, 2317, 41%7D;%0A        MergeSort sort = new MergeSort();%0A        sort.mergeSort(arr, 0, arr.length - 1);%0A        for (int i : arr) %7B%0A            System.out.print(i + %22, %22);%0A        %7D%0A        System.out.println();%0A    %7D%0A%7D%0A

Add merge sort