Selection sort is another algorithm which you might already be familiar with. This time you look through the entire list and select the (smallest/biggest/first/last/etc.) element.
![](https://i.imgur.com/hsPYlFq.gif)
http://www.sorting-algorithms.com
- Start at one end of the list.
- Traverse the list to the end.
- Go through the entire rest of the list to find the smallest/first/etc. element (based on how you are sorting).
- Once you reach the end of the inner traversal, swap the positions of the smallest element and the original element you were on.