if p < r;
q = Partition(A,p,r)
Quicksort(A,p,q - 1)
Quicksort(A,q + 1,r)
i = p-1
for j = p to r-1
if A[j] ≤ A[r]
i = i + 1
exchange A[i] with A[j]
exchange A[i+1] with A[r]
return i+1
|
|