You're replying to a comment by Richie.

Richie Permalink
July 07, 2009, 12:34

Without reading your analysis it's clear that LnearFibonacci computes all the fib numbers up to "n", and then throws all but the last number away. Next time it recomputes the same numbers again, so of course you get complexity O(n^2).

If the function filled an array then computation would be linear and only one call would be required.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "halflife3_147": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.