Re:Sort an array using only one local variable
by prmichaelsen on Saturday April 23, 2016 @09:21PM
(#11558163)
Interesting, I had never heard of External Merge Sort before. You are correct in that it does not work on unsigned ints and is unnecessarily slow.
An interesting alternative came to my attention in the form of "gnome sort". Gnome sort is also affectionately know as "stupid sort". It behaves similarly to bubble sort. Bubble sort "sinks" large elements which allows small elements to "bubble" up. Gnome sort, however, sinks large elements towards the end of the array AND sinks small elements towards the front of the array.
An interesting alternative came to my attention in the form of "gnome sort". Gnome sort is also affectionately know as "stupid sort". It behaves similarly to bubble sort. Bubble sort "sinks" large elements which allows small elements to "bubble" up. Gnome sort, however, sinks large elements towards the end of the array AND sinks small elements towards the front of the array.
More on gnome sort: https://en.wikipedia.org/wiki/Gnome_sort
Once again, thanks for reading!