add notation of m and n in analysis of complexity (#1621)

* fix: notation of m and n in analysis of complexity

As title, complexity variable is not defined previously.

* Update dp_solution_pipeline.md

* Update dp_solution_pipeline.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
Peter Chen; Kohan Chen
2025-01-21 19:18:03 +08:00
committed by GitHub
parent 98daefa67a
commit 18027ee26c

View File

@ -110,7 +110,7 @@ $$
![暴力搜索递归树](dp_solution_pipeline.assets/min_path_sum_dfs.png)
每个状态都有向下和向右两种选择从左上角走到右下角总共需要 $m + n - 2$ 所以最差时间复杂度为 $O(2^{m + n})$ 请注意这种计算方式未考虑临近网格边界的情况当到达网络边界时只剩下一种选择因此实际的路径数量会少一些
每个状态都有向下和向右两种选择从左上角走到右下角总共需要 $m + n - 2$ 所以最差时间复杂度为 $O(2^{m + n})$ 其中 $n$ $m$ 分别为网格的行数和列数请注意这种计算方式未考虑临近网格边界的情况当到达网络边界时只剩下一种选择因此实际的路径数量会少一些
### 方法二:记忆化搜索