Partition-based sort known for strong average-case performance.
Easy Explanation
Quick Sort picks a pivot, groups smaller values to one side and larger values to the other, then repeats.
Renderer Mode
`Simple` uses abstract, short-form-friendly visuals. `Advanced` keeps the current detailed view.
Comparisons
0
Swaps
0
Partitions
0
Depth
n/a
Press Play or Step to start execution.
function quickSort(values, low, high):
if low >= high:
return
pivot <- values[high]
store <- low
for i from low to high - 1:
if values[i] < pivot:
swap values[i], values[store]
store <- store + 1
swap values[store], values[high]
quickSort(values, low, store - 1)
quickSort(values, store + 1, high)