(int arr[], int left, int right)
| 34 | } |
| 35 | |
| 36 | public static void quickSort(int arr[], int left, int right) { |
| 37 | int index = partition(arr, left, right); |
| 38 | if (left < index - 1) { // Sort left half |
| 39 | quickSort(arr, left, index - 1); |
| 40 | } |
| 41 | if (index < right) { // Sort right half |
| 42 | quickSort(arr, index, right); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | public static void main(String[] args) { |
| 47 | int[] arr = AssortedMethods.randomArray(20, 0, 20); |