Definition:
A process designed to sort an unordered set of linear data into either ascending order (lowest to highest) or descending order (highest to lowest). This is done by comparing the first item in the list to all of the items to the right of it. Assuming that we are sorting the list in ascending order, the lowest element in the list and the first element are swapped (if the first element is the lowest element, it remains in place). This same process is now repeated with the second element in the list and all those to the right of it. Then, it is repeated with the third element, fourth, and so on until the second to last element. See an example of the procedure below.
Procedure for ASCENDING Selection Sort:
Fun Fact: Selection sort is one of the simplest sorting algorithms available but also one of the slowest. For a dataset containing 10,000 elements, a quick sort sorts the data over 700 times faster than a selection sort.
Commonly Used In: