My solution for a selection sort function that swaps min and max values with each linear scan.