Bubble&Quick Sort
Bubble&Quick Sort
Then the third smallest gets swapped with the third number.
The fourth smallest with the fourth number, and so on.
8 1 1 1 1 1 1 1
3 3 2 2 2 2 2 2
5 5 5 3 3 3 3 3
2 2 3 5 4 4 4 4
7 7 7 7 7 5 5 5
9 9 9 9 9 9 6 6
1 8 8 8 8 8 8 7
4 4 4 4 5 7 7 8
6 6 6 6 6 6 9 9
Selection with Interchange
Sort Algorithm Wiltshire
On the last pass you can see that the list has already been sorted.
However, similar to previous algorithms all steps must be carried out to
ensure the process works correctly.
8 1 1 1 1 1 1 1 1
3 3 2 2 2 2 2 2 2
5 5 5 3 3 3 3 3 3
2 2 3 5 4 4 4 4 4
7 7 7 7 7 5 5 5 5
9 9 9 9 9 9 6 6 6
1 8 8 8 8 8 8 7 7
4 4 4 4 5 7 7 8 8
6 6 6 6 6 6 9 9 9
Selection with Interchange
Sort Algorithm Wiltshire
8 3 5 2 7 9 1 4 6
3 5 2 1 4 6 7 8 9
1 3 5 2 4 6 8 9
2 3 5 4 6 8
3 4 5 6
3 5 6
5
1 2 3 4 5 6 7 8 9