Mac Player
macrumors regular
@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.