Concept Flow - DP vs Recursion vs Greedy Choosing the Right Tool
Start Problem
Is problem optimal substructure?
|Yes
Is problem overlapping subproblems?
Use DP
Build solution bottom-up or memoize
If no optimal substructure
Use Greedy if local choices lead to global optimum
End
Decide which method to use by checking if the problem has optimal substructure and overlapping subproblems; use DP if both, recursion if only optimal substructure, and greedy if local choices lead to global optimum.
