$./insertionsort
preset:
2 step/s
# algorithm
1insertionSort(A, n)
2begin
3 for i1 to n-1 do
4 keyA[i]
5 ji - 1
6 while j0 and A[j] > key do
7 A[j+1]A[j]
8 jj - 1
9 A[j+1]key
10end
# array visualization
64
0
34
1
25
2
12
3
22
4
11
5
90
6
key comparing shifting inserted sorted
# variables
i
j
key
insert
# progress
sorted portion
[0..0]
unsorted portion
[1..6]
# current operation
No active operation
# current action
select a preset and click "run" to begin...
# array state
[64,34,25,12,22,11,90]