"The worst algorithm in the world?"
11–20 of 73 posts
Re: "The worst algorithm in the world?"
#12I always liked the sort where you randomize the elements, check to see if they're sorted, and if not try again.
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...
Re: "The worst algorithm in the world?"
#13Re: "The worst algorithm in the world?"
#14Interesting writeup, thanks. OT: For all its fame, has any of you ever needed to calculate Fibbonacci numbers in real life? I haven't.
[Edit:] But there are some interesting data structures based on them: http://en.wikipedia.org/wiki/Fibonacci_heap
Re: "The worst algorithm in the world?"
#15Very good demonstration of subsequent improvements of a naive algorithm. To me that was somewhat depreciated by the fact that you can actually calculate n-the Fibonacci number using Binet's closed form formula ( http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_ex... ). You will need arbitrary precision arithmetic starting with certain 'n' though, as IEEE 754 will not give you correct result.
Re: "The worst algorithm in the world?"
#16Interesting writeup, thanks. OT: For all its fame, has any of you ever needed to calculate Fibbonacci numbers in real life? I haven't.
And neither am I a member of the Fibonacci Association http://www.mathstat.dal.ca/fibonacci/ http://www.fq.math.ca/ [Edit:] But there are some interesting data structures based on them: http://en.wikipedia.org/wiki/Fibonacci_heap
Re: "The worst algorithm in the world?"
#17I always liked the sort where you randomize the elements, check to see if they're sorted, and if not try again.
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. http://en.wikipedia.org/wiki/Bogosort#Quantum_bogosort
http://en.wikipedia.org/wiki/Quarantine_%28Greg_Egan_novel%2...
Re: "The worst algorithm in the world?"
#18It seems the author hasn't read SICP: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html...
Re: "The worst algorithm in the world?"
#19Since the Fibonacci numbers are defined by a linear recurrence, we can express the recurrence as a matrix, and it’s easy to verify that...
It's been way too long since my math minor for me to understand that.
Re: "The worst algorithm in the world?"
#20Very good demonstration of subsequent improvements of a naive algorithm. To me that was somewhat depreciated by the fact that you can actually calculate n-the Fibonacci number using Binet's closed form formula ( http://en.wikipedia.org/wiki/Fibonacci_number#Closed-form_ex... ). You will need arbitrary precision arithmetic starting with certain 'n' though, as IEEE 754 will not give you correct result.
(The asymptotic complexity is surely the same, in any case.)