# GnomeSort

The Gnome sort is similar to insertion sort, but the elements are moved in position by a serie of swaps just like in bubble sort. It is named after the supposed behavior of garden gnomes when they sort flower pots. Here is a description of the algorithm by its author:

Gnome Sort is based on the technique used by the standard Dutch Garden Gnome (Du.: tuinkabouter). Here is how a garden gnome sorts a line of flower pots. Basically, he looks at the flower pot next to him and the one immediately after ; if they are in the right order he steps one pot forward, otherwise he swaps them and steps one pot backwards. Boundary conditions: if there is no previous pot, he steps forwards; if there is no pot next to him, he is done. —Dick Grune