Clarifying Some Questions About Dynamic Programming
Note
Now all the plugins has supported English. I'm still improving the website...
This article is a revised version of the old article Dynamic Programming Q&A. Based on my continuous learning and summarization, as well as feedback from readers, I have expanded the content to make this article a comprehensive Q&A follow-up to Dynamic Programming Core Framework. Here is the main content.
This article will clarify the following questions for you:
What exactly is "optimal substructure" and how is it related to dynamic programming.
How to determine if a problem is a dynamic programming problem, i.e., how to identify if there are overlapping subproblems.
Why is the size of the
dp
array often set ton + 1
instead ofn
.Why are there various ways to traverse the
dp
array in dynamic programming, such as forward, backward, and diagonal traversal.