•Think of the array as being split into two – the sorted part and the unsorted part. (the sorted array initially has zero elements)
–Find the
smallest element i of the unsorted part.
–Swap i with the
element at the end of the sorted part
of the array.
–This
increases the size of the sorted portion by one element and decreases the size of the unsorted array.
–When the unsorted part has size zero and the sorted part has all the elements we are done.
–
–