Read 7.8 of Webber. Write an SML function selsort:'a list -> 'a list
that takes a list of ints and returns a sorted version of that list using the
selection sort algorithm. Recall that selection sort works as follows:
- An empty or single-element list is already sorted
- For a list of two or more elements, the sorted list is the
smallest element in the list followed by a sorted version of the rest of the
list.
I have written this so that you can see the recursive structure, even though
we didn't think of it this way when we studied selection sort in previous
classes. All you have to do is figure out how to find a) the smallest
element in the list, and b) the rest of the list, that is, the list without
the smallest element. Use let as necessary to name and/or avoid
recomputing intermediate values.