Learn
Practice
Newsletter
Resources
Mobile
New
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Selection Sort
Bookmark
Input
Random Array
Small
Reverse Sorted
Already Sorted
Nearly Sorted
All Equal
Custom
arr
=
[29, 10, 14, 37, 13, 8]
0
1
2
3
4
5
29
10
14
37
13
8
0
1
2
3
4
5
29
10
14
37
13
8
pass =
1
min_idx =
1
0
1
2
3
4
5
29
10
14
37
13
8
min
i
j
14
≥
10
→
keep min
pass =
1
min_idx =
5
0
1
2
3
4
5
29
10
14
37
13
8
min
i
j
8
<
10
→
new minimum
, min_idx =
5
pass =
2
min_idx =
1
0
1
2
3
4
5
29
10
14
37
13
8
min
i
j
14
≥
10
→
keep min
pass =
2
min_idx =
1
0
1
2
3
4
5
29
10
14
37
13
8
min
i
j
29
≥
10
→
keep min
pass =
3
min_idx =
2
0
1
2
3
4
5
29
10
14
37
13
8
min
i
j
37
<
14
?
pass =
3
min_idx =
4
0
1
2
3
4
5
29
10
14
37
13
8
min
i
min_idx (
4
) ≠ i (
2
) ?
pass =
4
min_idx =
4
0
1
2
3
4
5
29
10
14
37
13
8
min
i
j
29
<
14
?
pass =
5
min_idx =
4
0
1
2
3
4
5
29
10
14
37
13
8
min
i
assume arr[
4
] =
37
is the minimum
0
1
2
3
4
5
29
10
14
37
13
8
Array is sorted
algo
master
.
io
Step:
Start: sort the array in ascending order with selection sort
0 / 56
Input
Random Array
Small
Reverse Sorted
Already Sorted
Nearly Sorted
All Equal
Custom
arr
=
[29, 10, 14, 37, 13, 8]
0 / 56
algo
master
.
io
Step:
Start: sort the array in ascending order with selection sort