package ru.job4j.array;

/**
 * BubbleSort.
 *
 * @author mklimentiev
 * @version 1.0
 * @since 19.04.2017
*/
public class BubbleSort {
	/**
	 * sort.
	 * The method int[] sort(int[] array) get array sort it from smallest to largest and return sorted array
	 * @param array consisting of numbers of integer type
	 * @return sorted array
	*/
	public int[] sort(int[] array) {
		for (int i = 1; i < array.length; i++) {
			for (int j = 1; j < array.length; j++) {
				if (array[j] < array[j - 1]) {
					int temp = array[j];
					array[j] = array[j - 1];
					array[j - 1] = temp;
				}
			}
		}
		return array;
	}
}
@@ -430,15 +430,8 @@
  j =
- 1; j %3C
  arr
@@ -443,13 +443,25 @@
 ngth
-; j++
+ - 1; j %3E= i; j--
 ) %7B%0A
@@ -518,16 +518,20 @@
  array%5Bj
+ - 1
 %5D;%0A%09%09%09%09%09
@@ -537,16 +537,20 @@
 %09array%5Bj
+ - 1
 %5D = arra
@@ -544,36 +544,32 @@
 j - 1%5D = array%5Bj
- - 1
 %5D;%0A%09%09%09%09%09array%5Bj 
@@ -563,28 +563,24 @@
 %09%09%09%09%09array%5Bj
- - 1
 %5D = temp;%0A%09%09

change inner for