| Article: |
Technologies to Watch: A Look at Four That May Challenge Javas Development Dominance | |
| Subject: | fibonacci | |
| Date: | 2005-10-21 11:58:56 | |
| From: | tcowan | |
|
The fibonacci example was a straw man.
|
||
Showing messages 1 through 1 of 1.
-
fibonacci
2005-10-22 09:15:13 Nonymous [View]



The answer is fib(40) = 165,580,141 but your "pritty" algorith will require 1,402,817,465 method calls.
The algorithm you mentioned as a "straw man" requires only 40 steps to evaluate fib(40).
As a conclusion I think perhaps Java doesn't encourage to think about what you are writing.