Partitions the array around a pivot element, then recursively sorts the resulting subarrays.
p = a[high]i = low - 1for j from low to high - 1if a[j] < pi++if i != j: swap a[i], a[j]swap a[i + 1], a[high]pivot is in final positionquicksort(low, pivotIndex - 1)quicksort(pivotIndex + 1, high)done