Lingo

Selection Sort Visualiser

Step through each pass and watch the minimum swap into the front of the unsorted region.

Input

Scan for the minimum, then swap it into the front of the unsorted region.

24

Complexity

Operations for n elements.

  • Best O(n²)
  • Average O(n²)
  • Worst O(n²)

Not stable · In place

Array
24
5
8
23
6
2
17
21
20
13
15
12
19
7
14
11
10
18
1
22
4
3
16
9

Scan the unsorted region for its minimum, then swap it into place.

1 / 25
0Comparisons
0Writes
1/25Steps
RunningResult

Selection sort done.