$./quicksort
preset:
2 step/s
# algorithm
1quicksort(A, low, high)
2begin
3 if low < high then
4 ppartition(A, low, high)
5 quicksort(A, low, p-1)
6 quicksort(A, p+1, high)
7end
8
9partition(A, low, high)
10begin
11 pivotA[high]
12 ilow - 1
13 for jlow to high-1 do
14 if A[j]pivot then
15 ii + 1
16 swap A[i]A[j]
17 swap A[i+1]A[high]
18 return i + 1
19end
# array visualization
64
0
34
1
25
2
12
3
22
4
11
5
90
6
45
7
pivot comparing swapping sorted partition
# variables
low
high
i
j
# pivot
index:
value:
# call stack (recursion)
empty
# current action
select a preset and click "run" to begin...
# array state
[64,34,25,12,22,11,90,45]