$./selectionsort
preset:
2 step/s
# algorithm
1selectionSort(A, n)
2begin
3 for i0 to n-2 do
4 minIdxi
5 for ji+1 to n-1 do
6 if A[j] < A[minIdx] then
7 minIdxj
8 swap A[i]A[minIdx]
9end
# array visualization
64
0
25
1
12
2
22
3
11
4
34
5
90
6
position i comparing j current min swapping sorted
# variables
i
j
minIdx
A[min]
# progress
sorted
0 / 7
pass
0 / 6
# minimum search
No active comparison
# current action
select a preset and click "run" to begin...
# array state
[64,25,12,22,11,34,90]