Friday, December 19, 2014

DP problems

Fibonacci, shortest path(bellmanford)

5 easy steps to DP
1. define subproblems
2. guess
3. relate subproblem solution
4. recurse & memorize or build dp table
5. solve the original number

No comments:

Post a Comment