Compare to Greedy and Divide_and_conquer

Greedy.
Build up a solution incrementally, myopically optimizing some local criterion.

Divide-and-conquer.
Break up a problem into sub-problem into sub-problems, solve each sub-problem independently, and combine solutions to sub-problems to form solution to original problem.

Dynamic programming.
Break up a problem into a series of overlapping sub-problems, and build up solutions to larger and larger sub-problem.

Dynamic programming hallmark

Optimal substructure
An optimal solution to a problem(instance) contains optimal solutions to subpreoblems.

Overlapping subproblems
A recursive solution contains a “small” number of distinct subproblems repeated many times.

Example:Weighted Interval Scheduling

Dynamic Programming

Dynamic Programming

Dynamic Programming

Dynamic Programming

Memoization是常常和动态规划搭配使用的解决重复计算问题的放法,其原理是自底向上计算值,并储存起来,需要用到的时候直接取存储的值,而不是像递归那样重新计算。

Dynamic Programming

Dynamic Programming

相关文章:

  • 2021-10-29
  • 2021-12-11
  • 2021-09-30
  • 2021-07-15
  • 2022-01-14
  • 2021-12-27
  • 2021-11-07
  • 2021-09-23
猜你喜欢
  • 2021-09-05
  • 2022-01-13
  • 2021-12-28
  • 2021-11-25
  • 2021-09-13
  • 2021-05-04
  • 2021-05-04
相关资源
相似解决方案