57
What is Memoization and Dynamic Programming? Let’s take an example in Python.

What is Memoization and Dynamic Programming? Let’s take an example in Python.

5 years ago
Anonymous $9jpehmcKty

https://medium.com/@diogoribeiro_94486/what-is-memoization-and-dynamic-programming-lets-take-an-example-in-python-7c01e9a4d19d

Memoization or Dynamic Programming is a technique of remembering solutions to sub-problems which will help us solve a larger problem.

Memoization or Dynamic Programming is a technique of solving a larger problem by breaking it down into simpler subproblems, solve subproblems, remember their results and use them to solve the larger problem. In Recursion, we learned that to solve a larger problem we create subproblems out of the larger problem. We keep creating sub-problems until we reach the smallest subproblem, a base case, to which we already know the solution. Then we use that to solve slightly larger sub-problem and so on. In the end, we will have a solution to the larger problem.