ubuntuguy
asked on
Calculate fibonacci series in linear time
Is there a way to calculate the fibonacci series in linear time instead of O(n^2)?
= get yourself a really, really big ALU chip :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
that's O(n) as long as f(n) is small enough to fit in an int
if adding large numbers is O(log(f(n)) then this method becomes O(n^2)
if adding large numbers is O(log(f(n)) then this method becomes O(n^2)
If you can do additions in O(1) then yes.