知识卡片
分治须明确缩小与合并
分治要写清三件事:把当前实例拆成更小的同类子问题、递归求解、把子结果合成原问题答案。
基例给出终止点。只证明递归调用“变小”还不够;合并步骤的成本也须计入运行时间递归式。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第4章 分治策略 · 查看原书依据
Divide the problem into one or more subproblems that are smaller instances of the same problem.
参考来源
- 位置:《算法导论(第4版)》第 4 章“Divide-and-Conquer”导言(`OEBPS/chapter004.xhtml`,文本字符 [0, 5000))。
- 结论依据:原文依次定义 Divide、Conquer、Combine 和 base case,并说明递归式刻画运行时间。
- 原始内容:Divide the problem into one or more subproblems that are smaller instances of the same problem.