Why the different ways of calling quicksort recursively?
问题 I've noticed a discrepancy in the way quicksort is called recursively. One way is quicksort(Array, left, right) x = partition(Array, left, right) quicksort(Array, left, x-1) quicksort(Array, x+1, right) partition(array, left, right) pivotIndex := choose-pivot(array, left, right) pivotValue := array[pivotIndex] swap array[pivotIndex] and array[right] storeIndex := left for i from left to right - 1 if array[i] ≤ pivotValue swap array[i] and array[storeIndex] storeIndex := storeIndex + 1 swap