Re: Fabonicseries Program required




To understand recusrion, you must first understand recursion


Come now. Everyone knows that the best way is:

static int fibonacci (int i) {
if (i <= 1)
return 1;
else
return fibonacci (i - 1) + fibonacci (i - 2);
}

--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"

.



Relevant Pages

  • Re: Fabonicseries Program required
    ... static int fibonacci { ... Is this a reasonable expectation? ... not for the algorithm as posted. ... recursive and so /can/ have the recursion optimised out. ...
    (comp.lang.java.programmer)
  • Re: Fabonicseries Program required
    ... static int fibonacci { ... "The blind rulers of Logres ... Teachers throughout the whole world use this one to explain recursion:D ...
    (comp.lang.java.programmer)