sorts.py

In this exercise, you will learn about the Gnome Sort, which was named by its inventor Hamid Sarbazi-Azad as the Stupid Sort. What is interesting is that our quadratic sorts have an inner and outer loop. This has a single loop. Here is the idea.
  1. If the list has fewer than two items, you are done.
  2. Otherwise proceed as follows.
    1. Start at the beginning of the list.
    2. Move right one.
    3. Check your value and the value to the left. If they are in order, move right one.
    4. If they are out of order, swap them and move one to the left. If you are at the beginning, move right one.
    5. Once you skid off the right hand end of the list, you are done.

Implement this as an in-place sort in a function called gnome.

You will implement the minisort algorithm we discussed in class.