News for hackers. Stuff that matters.
Re:Sort an array using only one local variable by jkot on Saturday April 23, 2016 @02:07PM (#11556617)
I think it does not work on unsigned ints, it is also fairly slow.

I find External Merge Sort pretty interesting.

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.

More on gnome sort: https://en.wikipedia.org/wiki/Gnome_sort

Once again, thanks for reading!