Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 570 Bytes

File metadata and controls

18 lines (16 loc) · 570 Bytes

学习笔记

动态规划 (动态递推 Dynamic Programming)

动态规划的实现及关键点

  • 动态规划和递归分治无本质区别
  • 共性: 找到重复子问题
  • 差异性: 最优子结构,中途可以淘汰次优解

DP 有筛选

  1. 最优子结构
  2. 存储中间状态
  3. 递推公式(状态方程,DP方程)

5 easy steps to DP

  1. define subproblems
  2. guess (part of the solution)
  3. retate subproblem soluion
  4. recurse & memorize or build up bottom-up
  5. solve origial problem by merging all subproblems