跳到主要内容

dynamic-programing

模式

Pattern

Dynamic Programming (DP)

Problem solving approach:

  1. Define subproblems
  2. Implement parts that need to be executed repeatedly to solve subproblems
  3. Identify and solve boundary conditions

Classic examples:

  1. Knapsack Problem
  2. Longest Common Subsequence (LCS)
  3. Matrix Chain Multiplication
  4. LeetCode Coin Change
  5. All-Pairs Shortest Path in Graphs