Concept Flow - DP vs Recursion vs Greedy Choosing the Right Tool
Start Problem
Is problem optimal substructure?
|Yes
Is problem overlapping subproblems?
Use DP
Is greedy choice property valid?
Use Greedy
Solve Problem
End
Decide the right tool by checking problem properties: optimal substructure, overlapping subproblems, and greedy choice property.
