I came across three algorithms to compute the nth Fibonacci number. The last one is beautiful :)
(1) Recursive algorithm (exponential time)
(2) Non-recursive algorithm (linear time)
(3) Algorithm based on the usage of matrices (logarithmic time)
For details, refer http://en.wikipedia.org/wiki/Fibonacci_number
Monday, May 15, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment