Interactive selection sort. Scan the unsorted side for the smallest value, then swap it into the next sorted slot.

Array · n=8 unsorted scan min swap locked
Step 0 / 0

Press Play. Each round finds the smallest remaining value and swaps it into the next sorted slot.

Speed
comparisons
0
swaps
0
round
0
progress
0%
for i in 0 … n-1
min = i
for j in i+1 … n-1
if a[j] < a[min]
min = j
swap a[i], a[min]
timeline0 / 0
space  walk steps