Concept Flow - Greedy vs DP How to Know Which to Apply
Start Problem
Check if problem has optimal substructure?
Yes
Check if problem has overlapping subproblems?
Yes No
Use DP
Solve
End
Start by checking if the problem can be broken into smaller parts with optimal solutions. If yes, check if these parts overlap. Use DP if overlapping, else Greedy.
