static void QSort(int[] arr, int start, int end) { int i = start; int j = end; int privot = arr[i]; while (i < j) { while (i < j && privot <= arr[j]) { j--; } arr[i] = arr[j]; while (i < j && privot >= arr[i]) { i++; } arr[j] = privot; if (i > start) { QSort(arr, start, i - 1); } if (i < end) { QSort(arr, i + 1, end); } } }