Update the book based on the revised second edition (#1014)

* Revised the book

* Update the book with the second revised edition

* Revise base on the manuscript of the first edition
This commit is contained in:
Yudong Jin
2023-12-28 18:06:09 +08:00
committed by GitHub
parent 19dde675df
commit f68bbb0d59
261 changed files with 643 additions and 647 deletions

View File

@@ -19,7 +19,7 @@
如下图所示,对于问题 $f(1)$ ,即当只有一个圆盘时,我们将它直接从 `A` 移动至 `C` 即可。
=== "<1>"
![规模为 1 问题的解](hanota_problem.assets/hanota_f1_step1.png)
![规模为 1 问题的解](hanota_problem.assets/hanota_f1_step1.png)
=== "<2>"
![hanota_f1_step2](hanota_problem.assets/hanota_f1_step2.png)
@@ -31,7 +31,7 @@
3. 最后将小圆盘从 `B` 移至 `C`
=== "<1>"
![规模为 2 问题的解](hanota_problem.assets/hanota_f2_step1.png)
![规模为 2 问题的解](hanota_problem.assets/hanota_f2_step1.png)
=== "<2>"
![hanota_f2_step2](hanota_problem.assets/hanota_f2_step2.png)
@@ -55,7 +55,7 @@
3.`C` 为目标柱、`A` 为缓冲柱,将两个圆盘从 `B` 移至 `C`
=== "<1>"
![规模为 3 问题的解](hanota_problem.assets/hanota_f3_step1.png)
![规模为 3 问题的解](hanota_problem.assets/hanota_f3_step1.png)
=== "<2>"
![hanota_f3_step2](hanota_problem.assets/hanota_f3_step2.png)
@@ -66,7 +66,7 @@
=== "<4>"
![hanota_f3_step4](hanota_problem.assets/hanota_f3_step4.png)
从本质上看,**我们将问题 $f(3)$ 划分为两个子问题 $f(2)$ 和子问题 $f(1)$** 。按顺序解决这三个子问题之后,原问题随之得到解决。这说明子问题是独立的,而且解可以合并。
从本质上看,**我们将问题 $f(3)$ 划分为两个子问题 $f(2)$ 和一个子问题 $f(1)$** 。按顺序解决这三个子问题之后,原问题随之得到解决。这说明子问题是独立的,而且解可以合并。
至此,我们可总结出下图所示的解决汉诺塔问题的分治策略:将原问题 $f(n)$ 划分为两个子问题 $f(n-1)$ 和一个子问题 $f(1)$ ,并按照以下顺序解决这三个子问题。