Re:"The worst algorithm in the world?"
by michaelcampbell on Wednesday May 11, 2011 @03:48PM
(#2538099)
I always liked the sort where you randomize the elements, check to see if they're sorted, and if not try again.
[ Parent
| on HN ]
My 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_s...
Yeah, 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.
If you enjoyed that you might like the novel Quarantine by Greg Egan:
http://en.wikipedia.org/wiki/Quarantine_%28Greg_Egan_novel%2...
Re:"The worst algorithm in the world?"
by masterzora on Wednesday May 11, 2011 @06:09PM
(#2538619)
I 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