ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Technologies to Watch: A Look at Four That May Challenge Java’s Development Dominance
Subject:   fibonacci
Date:   2005-10-22 09:15:13
From:   Nonymous
Response to: fibonacci

Apparently you are not found in recurrent successions, your algorithm is unusable. Try evaluating fib(40).

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.