Algorithms Review, Part 2
I have been reading a book on algorithms lately, and I thought I would do a review of the algorithms the book covers. The book, "Grokking Algorithms, Second Edition" by Aditya Bhargava, is well worth a read if you haven't studied algorithms or if you would like a refresher. In Part 1 of this series, I wrote about the binary search algorithm. Today, I am going to write about the selection sort algorithm.
What is selection sort? It is an algorithm that rolls through a set of data and sorts the data on whatever criteria you specify. It is useful for sorting lists of data. In the book, the author uses the example of a list of music artists and sorting the list by play count. He doesn't provide the code for this example, so I thought I would provide an example for you to review.