The Selectionsort Algorithm
p
The process
continues...
Sorted side
Unsorted side
Sorted side
is bigger
[0]
[1]
[2]
[3]
[4]
[5]
The sorted side now contains the three smallest elements of the array.