public void sort(int[] array) { int length = array.Length; for (int i = 0; i < length - 1; i++) { for (int j = length - 1; j > 1; j--) { if (array[j] < array[i - 1]) { int tmp = array[j]; array[j] = array[j - 1]; array[j - 1] = tmp; } } }