知识卡片
朴素递归重复相同切杆
直接按切杆递推递归调用,会反复求同一剩余长度的最优收入。
长度 n 有 n−1 个可切位置,切法达 2^(n−1);递归树中大量同标签节点解释了指数工作量,问题不在于状态数量本身多。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第14章 动态规划 · 查看原书依据
The problem is that CUT-ROD calls itself recursively over and over again with the same parameter values, which means that it solves the same subproblems repeatedly.
参考来源
- 位置:《算法导论(第4版)》第 14 章 14.1 节(`OEBPS/chapter014.xhtml`,文本字符 [5000, 15000);图 14.3、Art_P452–P454)。
- 结论依据:CUT-ROD 对每个 i 递归计算余长 n−i;原文指出同一参数值被多次调用,并以 n=4 的递归树展示重复状态与指数增长。
- 原始内容:The problem is that C UT -R OD calls itself recursively over and over again with the same parameter values, which means that it solves the same subproblems repeatedly.