4 ms·
I always liked the sort where you randomize the elements, check to see if they're sorted, and if not try again.
by michaelcampbell 16y ago
I always liked the sort where you randomize the elements, check to see if they're sorted, and if not try again.
- cmaggard 16y agoYeah, I recalled the name as random sort, and was pleasantly surprised when the bogosort link directed to the same algorithm. I particularly enjoyed the "Quantum Bogosort" algorithm on the Wiki page. http://en.wikipedia.org/wiki/Bogosort#Quantum_bogosort http://en.wikipedia.org/wiki/Bogosort#Quantum_bogosort
- arethuza 16y agoIf you enjoyed that you might like the novel Quarantine by Greg Egan: http://en.wikipedia.org/wiki/Quarantine_%28Greg_Egan_novel%29 http://en.wikipedia.org/wiki/Quarantine_%28Greg_Egan_novel%2...
- ginkgo 16y agoMy personal favorite has always been permutation sort, where you try all possible permutations of a sequence and check if it is sorted. What's nice about it is that it is deterministic yet ridiculously slow. It can also be really easily implemented in Prolog[1] where you simply define what a permutation and being sorted means. After that you just search for a sorted permutation. [1] http://rosettacode.org/wiki/Sorting_algorithms/Permutation_sort#Prolog http://rosettacode.org/wiki/Sorting_algorithms/Permutation_s...
- masterzora 16y agoI never understood why Bogosort made the check so efficient; it seems so silly. Fortunately, somebody solved this problem and made bogobogosort: http://www.dangermouse.net/esoteric/bogobogosort.html http://www.dangermouse.net/esoteric/bogobogosort.html