The Selectionsort Algorithm
pPart of the array is now sorted.
Sorted side
Unsorted side
[0]       [1]        [2]       [3]        [4]       [5] 
At this point, we can view the array as being split into two sides: To the left of the dotted line is the "sorted side", and to the right of the dotted line is the "unsorted side". Our goal is to push the dotted line forward, increasing the number of elements in the sorted side, until the entire array is sorted.