Don't exaggerate recursion overhead

A small pet peeve of mine is when people use the very na├»ve recursive implementation of the Fibonacci algorithm to show the overhead of recursion. Yes, recursion can have an overhead (depending on your environment), but it’s not nearly as much as you make it seem. The problem, The iterative version of the Fibonacci algorithm: def iterative_fibonacci(n): a, b = 0, 1 for _ in range(n): a, b = b, a + b return a has O(n) time complexity. [Read More]