知识卡片
分治递归须写清分解求解合并
分治先把问题拆成更小的同类子问题,递归求解,再合并答案,并为足够小的输入设直接求解的基本情况。
归并排序以单元素为基本情况,递归排好左右半区,再把两个有序段归并。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 第2章 算法入门 · 查看原书依据
they break the problem into several subproblems that are similar to the original problem but smaller in size, solve the subproblems recursively, and then combine these solutions to create a solution to the original problem.
参考来源
- 位置:《算法导论(第4版)》第 2 章 2.3.1 节“The divide-and-conquer method”(`OEBPS/chapter002.xhtml`,图 2.4)。
- 结论依据:原文列出 divide、conquer、combine 三步和基本情况,并用归并排序逐步说明。
- 原始内容:they break the problem into several subproblems that are similar to the original problem but smaller in size, solve the subproblems recursively, and then combine these solutions to create a solution to the original problem.