To illustrate the Simple Sort, we will order a hand of seven playing cards using this algorithm.

  1. First, we deal a hand of unsorted cards.


  2. As we sort these cards, we will repeatedly compare our unordered cards to find the smallest card. Then we will move this card to our sorted hand.


    Unsorted Hand

    Sorted Hand

  3. 7 is less than 8, but 5 is less than 7. Now five is our smallest card. 2 is less than 5, so 2 is the smallest. Since 2 is less than 4, 6, and 3, 2 is our smallest unsorted card, and we move it to the sorted hand.


    Unsorted Hand

    Sorted Hand

  4. Now we compare our unsorted cards again. 7 is less than 8, but 5 is less than 7. Now 5 is our smallest card. 4 is less than 5, so 4 is the smallest. 4 is less than 6 but not less than 3. This makes 3 our smallest unsorted card, so we move it to the sorted hand.


    Unsorted Hand

    Sorted Hand

  5. Now we compare our unsorted cards again. 7 is less than 8, but 5 is less than 7. Now five is our smallest card. 4 is less than 5, so 4 is the smallest. 4 is also less than 6 which makes 4 our smallest unsorted card, so we move it to the sorted hand.


    Unsorted Hand

    Sorted Hand

  6. Now we compare our unsorted cards again. 7 is less than 8, but 5 is less than 7. Now 5 is our smallest card. 5 is also less than 6 which makes 5 our smallest unsorted card, so we move it to the sorted hand.


    Unsorted Hand

    Sorted Hand

  7. Now we compare our unsorted cards again. 7 is less than 8, but 6 is less than 7. This makes 6 our smallest card, so we move it to the sorted hand.


    Unsorted Hand

    Sorted Hand

  8. Now we compare our unsorted cards again. 7 is less than 8, which makes 7 our smallest card, so we move it to the sorted hand.


    Unsorted Hand

    Sorted Hand

  9. This leaves a single card in our unsorted hand, so we move this card to the sorted hand. Since the unsorted hand is empty, our Simple Sort algorithm is complete.


    Unsorted Hand

    Sorted Hand
Animated version