package ru.matevosyan;

public class SortArray{

	public int[] sort(int[] arrFirst, int[] arrSecond){

		int j = 0;
		int i = 0;
		int k = 0;

		int length = arrFirst.length + arrSecond.length;
		int[] thirdArray = new int[length];
			
		while(i < arrFirst.length && j < arrSecond.length){
			
			if(arrFirst[i] <= arrSecond[j]){

				thirdArray[k] = arrFirst[i];

				i++;

			} else {

				thirdArray[k] = arrSecond[j];

				j++;

			}
		k++;
 		
		}

		while(i < arrFirst.length) {
		
			thirdArray[k] = arrFirst[i];

			i++;
			k++;

		}

		while(j < arrSecond.length) {
		
			thirdArray[k] = arrSecond[j];

			j++;
			k++;

		}




	return thirdArray;

	}

}
@@ -17,16 +17,130 @@
 osyan;%0A%0A
+/**%0A* %3Cp%3E%0A* This classe contain sort method.%0A* %3C/p%3E%0A*%0A* @since 1.0%0A* @author Matevosyan Vardan%0A* @version 1.0%0A*/%0A%0A
 public c
@@ -157,19 +157,222 @@
 rray
+ 
 %7B%0A%0A
-%09
+/**%0A*sort method that will return third sorted array.%0A*%0A* @param arrFirst it is passing first sorted array%0A* @param arrSecond it is passing second sorted array%0A* @return tag third sorted array%0A*/%0A%0A
 public 
+final 
 int%5B
@@ -378,16 +378,22 @@
 %5B%5D sort(
+final 
 int%5B%5D ar
@@ -399,16 +399,22 @@
 rrFirst,
+ final
  int%5B%5D a
@@ -422,21 +422,20 @@
 rSecond)
+ 
 %7B%0A%0A
-%09%09
 int j = 
@@ -433,26 +433,24 @@
 %0Aint j = 0;%0A
-%09%09
 int i = 0;%0A%09
@@ -448,18 +448,16 @@
  i = 0;%0A
-%09%09
 int k = 
@@ -460,18 +460,16 @@
 k = 0;%0A%0A
-%09%09
 int leng
@@ -509,18 +509,16 @@
 length;%0A
-%09%09
 int%5B%5D th
@@ -549,19 +549,15 @@
 h%5D;%0A
-%09%09%09%0A%09%09
+%0A
 while
+ 
 (i %3C
@@ -601,19 +601,15 @@
 gth)
+ 
 %7B%0A
-%09%09%09%0A%09%09%09
+%0A
 if
+ 
 (arr
@@ -633,23 +633,20 @@
 cond%5Bj%5D)
+ 
 %7B%0A%0A
-%09%09%09%09
 thirdArr
@@ -670,22 +670,14 @@
 i%5D;%0A
-%0A%09%09%09%09
 i++;%0A%0A
-%09%09%09
 %7D el
@@ -682,20 +682,16 @@
 else %7B%0A%0A
-%09%09%09%09
 thirdArr
@@ -716,47 +716,30 @@
 j%5D;%0A
-%0A%09%09%09%09
 j++;%0A%0A
-%09%09%09%7D%0A%09%09k++;%0A %09%09%0A%09%09%7D%0A%0A%09%09
+%7D%0Ak++;%0A%0A%7D%0A
 while
+ 
 (i %3C
@@ -750,38 +750,33 @@
 First.length) %7B%0A
-%09%09%0A%09%09%09
+%0A
 thirdArray%5Bk%5D = 
@@ -793,37 +793,28 @@
 %5D;%0A%0A
-%09%09%09
 i++;%0A
-%09%09%09
 k++;%0A%0A
-%09%09
 %7D%0A%0A
-%09%09
 while
+ 
 (j %3C
@@ -838,14 +838,9 @@
 ) %7B%0A
-%09%09%0A%09%09%09
+%0A
 thir
@@ -870,34 +870,22 @@
 %5D;%0A%0A
-%09%09%09
 j++;%0A
-%09%09%09
 k++;%0A%0A
-%09%09
 %7D%0A%0A
-%0A%0A%0A%09
 retu
@@ -903,10 +903,8 @@
 ay;%0A
-%0A%09%7D%0A%0A%7D
+%7D%0A%7D%0A

add SortAray.java