Section 2: Selection

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.


http://www.sorting-algorithms.com

  1. Start at one end of the list.
  2. 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.

← Previous PageNext Page →