Skip to content

Commit

Permalink
Update 最优子结构.md
Browse files Browse the repository at this point in the history
fix typo
  • Loading branch information
chengwhynot authored and labuladong committed Jun 22, 2020
1 parent b52ceef commit 1c97ad8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 动态规划系列/最优子结构.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ for (int l = 2; l <= n; l++) {

**2、遍历的终点必须是存储结果的那个位置**

下面来距离解释上面两个原则是什么意思
下面来具体解释上面两个原则是什么意思

比如编辑距离这个经典的问题,详解见前文「编辑距离详解」,我们通过对 `dp` 数组的定义,确定了 base case 是 `dp[..][0]``dp[0][..]`,最终答案是 `dp[m][n]`;而且我们通过状态转移方程知道 `dp[i][j]` 需要从 `dp[i-1][j]`, `dp[i][j-1]`, `dp[i-1][j-1]` 转移而来,如下图:

Expand Down Expand Up @@ -137,4 +137,4 @@ for (int i = 1; i < m; i++)

[下一篇:回溯算法解题框架](../算法思维系列/回溯算法详解修订版.md)

[目录](../README.md#目录)
[目录](../README.md#目录)

0 comments on commit 1c97ad8

Please sign in to comment.