Memoization
Memoization is a top-down dynamic programming technique that stores the results of previously computed subproblems so they do not need to be recalculated. It is particularly effective when a recursive algorithm has overlapping subproblems.
Without memoization, Fibonacci recursively recomputes the same values and has exponential time complexity. With memoization, each distinct subproblem is calculated once, reducing the time complexity to O(n), with O(n) additional space for the cache and recursion stack.
Memoization stores previously computed results.
It is commonly implemented using a hash map, object, or array.
It is useful for overlapping recursive subproblems.
It generally trades additional memory for improved execution time.
It is a top-down dynamic programming approach.