6 Dynamic Programming
6 Dynamic Programming
• What is (https://www.educative.io/courses/algorithms-coding-
Dynamic interviews-cpp/Y5YpG2MVE7n#what-is-dynamic-
Programming? programming)
• Characteristics(https://www.educative.io/courses/algorithms-coding-
interviews-cpp/Y5YpG2MVE7n#characteristics)
• Dynamic (https://www.educative.io/courses/algorithms-coding-
Programming interviews-cpp/Y5YpG2MVE7n#dynamic-programming-
Patterns patterns)
• Memoization (https://www.educative.io/courses/algorithms-coding-
(Top Down) interviews-cpp/Y5YpG2MVE7n#memoization-top-down)
• Tabulation (https://www.educative.io/courses/algorithms-coding-
(Bottom Up) interviews-cpp/Y5YpG2MVE7n#tabulation-bottom-up)
“Those who cannot remember the past are condemned to repeat it” –
Dynamic Programming
Characteristics #
(https://www.educative.io/courses/algorithms-coding-
interviews-cpp/Y5YpG2MVE7n#characteristics)
1. Overlapping Subproblems: the subproblems of a given problem are not
independent; in other words, two subproblems don’t share a
subsubproblem.
The top down memoization approach starts from a large problem and breaks it
down to smaller parts
The bottum up tabulation approach starts from a small problem and builds it up to
a larger one