Algorithms and Data Structures · Middle · Question 40 of 75

Which two properties make a problem a good fit for dynamic programming?

Explanation

Overlapping subproblems means the same sub-results are needed many times, so caching them pays off. Optimal substructure means the best answer is built from best answers to subproblems.

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 40

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz