diff --git a/docs/chapter_divide_and_conquer/build_binary_tree_problem.assets/built_tree_step10.png b/docs/chapter_divide_and_conquer/build_binary_tree_problem.assets/built_tree_overall.png similarity index 100% rename from docs/chapter_divide_and_conquer/build_binary_tree_problem.assets/built_tree_step10.png rename to docs/chapter_divide_and_conquer/build_binary_tree_problem.assets/built_tree_overall.png diff --git a/docs/chapter_divide_and_conquer/build_binary_tree_problem.md b/docs/chapter_divide_and_conquer/build_binary_tree_problem.md index fe909e918..a7a264b98 100644 --- a/docs/chapter_divide_and_conquer/build_binary_tree_problem.md +++ b/docs/chapter_divide_and_conquer/build_binary_tree_problem.md @@ -182,8 +182,9 @@ === "<9>" ![built_tree_step9](build_binary_tree_problem.assets/built_tree_step9.png) -=== "<10>" - ![built_tree_step10](build_binary_tree_problem.assets/built_tree_step10.png) +每个递归函数内的前序遍历 `preorder` 和中序遍历 `inorder` 的划分结果如下图所示。 + +![每个递归函数中的划分结果](build_binary_tree_problem.assets/built_tree_overall.png) 设树的节点数量为 $n$ ,初始化每一个节点(执行一个递归函数 `dfs()` )使用 $O(1)$ 时间。**因此总体时间复杂度为 $O(n)$** 。 diff --git a/docs/chapter_greedy/max_product_cutting_problem.assets/max_product_cutting_greedy_infer2.png b/docs/chapter_greedy/max_product_cutting_problem.assets/max_product_cutting_greedy_infer2.png index 25febf38c..1f06284ff 100644 Binary files a/docs/chapter_greedy/max_product_cutting_problem.assets/max_product_cutting_greedy_infer2.png and b/docs/chapter_greedy/max_product_cutting_problem.assets/max_product_cutting_greedy_infer2.png differ diff --git a/docs/chapter_greedy/max_product_cutting_problem.assets/max_product_cutting_greedy_infer3.png b/docs/chapter_greedy/max_product_cutting_problem.assets/max_product_cutting_greedy_infer3.png deleted file mode 100644 index 1f06284ff..000000000 Binary files a/docs/chapter_greedy/max_product_cutting_problem.assets/max_product_cutting_greedy_infer3.png and /dev/null differ diff --git a/docs/chapter_greedy/max_product_cutting_problem.md b/docs/chapter_greedy/max_product_cutting_problem.md index 3b3f000a6..9d44a2541 100644 --- a/docs/chapter_greedy/max_product_cutting_problem.md +++ b/docs/chapter_greedy/max_product_cutting_problem.md @@ -44,7 +44,7 @@ $$ **贪心策略二**:在切分方案中,最多只应存在两个 $2$ 。因为三个 $2$ 总是可以被替换为两个 $3$ ,从而获得更大乘积。 -![最优切分因子](max_product_cutting_problem.assets/max_product_cutting_greedy_infer3.png) +![最优切分因子](max_product_cutting_problem.assets/max_product_cutting_greedy_infer2.png) 总结以上,可推出以下贪心策略。 diff --git a/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_1.png b/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step1.png similarity index 100% rename from docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_1.png rename to docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step1.png diff --git a/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_2.png b/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step2.png similarity index 100% rename from docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_2.png rename to docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step2.png diff --git a/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_3.png b/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step3.png similarity index 100% rename from docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_3.png rename to docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step3.png diff --git a/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_4.png b/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step4.png similarity index 100% rename from docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_4.png rename to docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step4.png diff --git a/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_5.png b/docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step5.png similarity index 100% rename from docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step_5.png rename to docs/chapter_introduction/algorithms_are_everywhere.assets/binary_search_dictionary_step5.png diff --git a/docs/chapter_introduction/algorithms_are_everywhere.md b/docs/chapter_introduction/algorithms_are_everywhere.md index 2a3ceb153..423cd6b84 100644 --- a/docs/chapter_introduction/algorithms_are_everywhere.md +++ b/docs/chapter_introduction/algorithms_are_everywhere.md @@ -11,19 +11,19 @@ 3. 不断重复步骤 `1.` 和 步骤 `2.` ,直至找到拼音首字母为 $r$ 的页码为止。 === "<1>" - ![查字典步骤](algorithms_are_everywhere.assets/binary_search_dictionary_step_1.png) + ![查字典步骤](algorithms_are_everywhere.assets/binary_search_dictionary_step1.png) === "<2>" - ![binary_search_dictionary_step_2](algorithms_are_everywhere.assets/binary_search_dictionary_step_2.png) + ![binary_search_dictionary_step2](algorithms_are_everywhere.assets/binary_search_dictionary_step2.png) === "<3>" - ![binary_search_dictionary_step_3](algorithms_are_everywhere.assets/binary_search_dictionary_step_3.png) + ![binary_search_dictionary_step3](algorithms_are_everywhere.assets/binary_search_dictionary_step3.png) === "<4>" - ![binary_search_dictionary_step_4](algorithms_are_everywhere.assets/binary_search_dictionary_step_4.png) + ![binary_search_dictionary_step4](algorithms_are_everywhere.assets/binary_search_dictionary_step4.png) === "<5>" - ![binary_search_dictionary_step_5](algorithms_are_everywhere.assets/binary_search_dictionary_step_5.png) + ![binary_search_dictionary_step5](algorithms_are_everywhere.assets/binary_search_dictionary_step5.png) 查阅字典这个小学生必备技能,实际上就是著名的二分查找算法。从数据结构的角度,我们可以把字典视为一个已排序的“数组”;从算法的角度,我们可以将上述查字典的一系列操作看作是“二分查找”。