Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
@gnasher
Your recursive implementation is O(n), where an implementation using memoization is amortized O(1) (assuming fib() is called approximately n times).

Assuming you know the largest m for which fib() will be called.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.