The Gnome Sort is extremely simple and is very similar to the principle behind the Insertion Sort.
The Gnome Sort is yet another comparison and exchange sort which has elements that are similar to the Bubble Sort. If you haven’t read up on the Bubble Sort, be sure to do that before reading this article as it may help with your understanding.
The first principle to bear in mind when doing a Gnome Sort is that as the algorithm progresses, all items to the left of the current item are always in order. Each iteration of the algorithm moves the current item to the correct spot with respect to the previously sorte