Memoization
When a recursion solves the same subproblems again and again, as Fibonacci does, storing each answer the first time it is found turns exponential time into one computation per distinct subproblem.
When a recursion solves the same subproblems again and again, as Fibonacci does, storing each answer the first time it is found turns exponential time into one computation per distinct subproblem.