Implementing Selection Sort
We must have two loops, one nested in the other:
- Inner loop: Scans the unsorted part of the array for the (index
of the) largest element
- Outer loop: Controls how many times the inner loop is executed by
keeping track of how much of the array has been processed. Includes
swapping the largest element of the unsorted part with the element in the
highest location of the unsorted part.