AI engineering glossary · Data structures algorithms
What is DP (dynamic programming)?
Dynamic programming (also called DP): A method for solving problems by breaking them into overlapping subproblems, solving each only once and storing the answers for reuse. It applies when an optimal solution is built from optimal solutions of smaller pieces.
Dynamic programming: an example
Computing the 40th Fibonacci number by storing each earlier value takes 40 steps, while naive recursion repeats work over a hundred million times.
Related terms
More Data structures algorithms terms
Where you learn it
Dynamic programming is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.