@@ -0,0 +1,1344 @@
+package ru.sbulygin;%0A%0A/**%0A* Class MergeSort.%0A* @author sbulygin.%0A* @since 22.12.2016.%0A* @version 1.0.%0A*/%0A%0Apublic class MergeSort %7B%0A%0A    /**%0A    * Method bubbleSort.%0A    * This method merges two sorted arrays and returns a sorted array.%0A    * @param firstArray array of integer values.%0A    * @param secondArray array of integer values.%0A    * @return sortArray sorting array.%0A    */%0A    public int%5B%5D merg(int%5B%5D firstArray, int%5B%5D secondArray) %7B%0A        if (firstArray == null %7C%7C firstArray.length %3C= 1 %7C%7C secondArray == null %7C%7C secondArray.length %3C= 1) %7B%0A            throw new IllegalArgumentException(%22Array cannot have lenght %3C= 1 or equal to 0.%22);%0A        %7D%0A        int newLength = firstArray.length + secondArray.length;%0A        int%5B%5D sortArray = new int%5BnewLength%5D;%0A        int indexOne = 0;%0A        int indexTwo = 0;%0A        for (int i = 0; i %3C newLength; i++) %7B%0A            if (indexOne == firstArray.length) %7B%0A                sortArray%5Bi%5D = secondArray%5BindexTwo++%5D;%0A            %7D else if (indexTwo == secondArray.length) %7B%0A                sortArray%5Bi%5D = firstArray%5BindexOne++%5D;%0A            %7D else if (firstArray%5BindexOne%5D %3C secondArray%5BindexTwo%5D) %7B%0A                sortArray%5Bi%5D = firstArray%5BindexOne++%5D;%0A            %7D else %7B%0A                sortArray%5Bi%5D = secondArray%5BindexTwo++%5D;%0A            %7D%0A        %7D%0A        return sortArray;%0A    %7D%0A %7D

add 22.12