[prev] 24 [next]

Non-randomised Quicksort (cont)

... and Conquer!

Quicksort(array,low,high):
|  Input  array, index range low..high
|  Output array[low..high] sorted
|
|  if high > low then    // termination condition low >= high
|  |   pivot = partition(array,low,high)
|  |   Quicksort(array,low,pivot-1)
|  |   Quicksort(array,pivot+1,high)
|  end if