快速排序
/** * 快速排序 * @param numbers * @param left * @param right */ static void quickSort(int[] numbers,int left,int right){ System.out.println(Arrays.toString(numbers)); if(left < right) { int i = left,j = right; int x = numbers[left]; while(i < j) { while(i < j&& numbers[j] >= x){ j--; } if(i < j){ numbers[i++] = numbers[j]; } while(i < j&&numbers[i] <= x ){ i++; } if (i < j) { numbers[j--] = numbers[i]; } } numbers[i] = x; quickSort(numbers, left, i); quickSort(numbers, i + 1, right); } }