diff --git a/chapter_array_and_linkedlist/index.md b/chapter_array_and_linkedlist/index.md index 09edf5c98..6caec7185 100644 --- a/chapter_array_and_linkedlist/index.md +++ b/chapter_array_and_linkedlist/index.md @@ -11,6 +11,14 @@ icon: material/view-list-outline +!!! abstract + + 数组的砖块整齐排列,紧贴在一起。 + + 链表的砖块分散各处,连接的藤蔓自由地穿梭于砖缝之间。 + + 它们共同构成了数据结构的世界。 + ## 本章内容 - [4.1 数组](https://www.hello-algo.com/chapter_array_and_linkedlist/array/) diff --git a/chapter_backtracking/index.md b/chapter_backtracking/index.md index ab909f632..1ca6bcf7f 100644 --- a/chapter_backtracking/index.md +++ b/chapter_backtracking/index.md @@ -11,6 +11,12 @@ icon: material/map-marker-path +!!! abstract + + 我们如同迷宫中的探索者,在寻找出口的道路上可能会遇到困难。 + + 回溯的力量让我们能够重新开始,最终寻找到正确的道路。 + ## 本章内容 - [13.1 回溯算法](https://www.hello-algo.com/chapter_backtracking/backtracking_algorithm/) diff --git a/chapter_computational_complexity/index.md b/chapter_computational_complexity/index.md index 958e013ea..c9f093318 100644 --- a/chapter_computational_complexity/index.md +++ b/chapter_computational_complexity/index.md @@ -11,6 +11,12 @@ icon: material/timer-sand +!!! abstract + + 复杂度犹如浩瀚的算法宇宙中的指南针。 + + 它引导我们在时间与空间的维度上深入探索,寻找更优雅的解决方案。 + ## 本章内容 - [2.1 算法效率评估](https://www.hello-algo.com/chapter_computational_complexity/performance_evaluation/) diff --git a/chapter_data_structure/index.md b/chapter_data_structure/index.md index 9d829c9ee..4b0baa7bf 100644 --- a/chapter_data_structure/index.md +++ b/chapter_data_structure/index.md @@ -11,6 +11,12 @@ icon: material/shape-outline +!!! abstract + + 数据结构如同一副稳固而多样的框架。 + + 它为数据的有序组织提供了蓝图,使算法得以在此基础上生动起来。 + ## 本章内容 - [3.1 数据结构分类](https://www.hello-algo.com/chapter_data_structure/classification_of_data_structure/) diff --git a/chapter_divide_and_conquer/index.md b/chapter_divide_and_conquer/index.md index 8a6687739..b5bfb1e83 100644 --- a/chapter_divide_and_conquer/index.md +++ b/chapter_divide_and_conquer/index.md @@ -12,6 +12,12 @@ status: new +!!! abstract + + 分治一次又一次地拆解难题,每一次的拆解都让问题变得更为简单。 + + 从简单做起,一切都不再复杂。 + ## 本章内容 - [12.1 分治算法](https://www.hello-algo.com/chapter_divide_and_conquer/divide_and_conquer/) diff --git a/chapter_dynamic_programming/index.md b/chapter_dynamic_programming/index.md index 2dc2c6abb..7e507cdd1 100644 --- a/chapter_dynamic_programming/index.md +++ b/chapter_dynamic_programming/index.md @@ -12,6 +12,12 @@ status: new +!!! abstract + + 小溪汇入河流,江河汇入大海。 + + 动态规划将小问题的解汇集成大问题的答案,一步步引领我们走向解决问题的彼岸。 + ## 本章内容 - [14.1 初探动态规划](https://www.hello-algo.com/chapter_dynamic_programming/intro_to_dynamic_programming/) diff --git a/chapter_graph/index.md b/chapter_graph/index.md index 27c50834f..8c0ad2969 100644 --- a/chapter_graph/index.md +++ b/chapter_graph/index.md @@ -11,6 +11,12 @@ icon: material/graphql +!!! abstract + + 在生命旅途中,我们就像是每个节点,被无数看不见的边相连。 + + 每一次的相识与相离,都在这张巨大的网络图中留下独特的印记。 + ## 本章内容 - [9.1 图](https://www.hello-algo.com/chapter_graph/graph/) diff --git a/chapter_greedy/index.md b/chapter_greedy/index.md index af6553a5a..c86db27e8 100644 --- a/chapter_greedy/index.md +++ b/chapter_greedy/index.md @@ -12,6 +12,12 @@ status: new +!!! abstract + + 向日葵朝着太阳转动,时刻都在追求自身成长的最大可能。 + + 这便是贪心的智慧,一种简单且高效的问题求解策略。 + ## 本章内容 - [15.1 贪心算法](https://www.hello-algo.com/chapter_greedy/greedy_algorithm/) diff --git a/chapter_hashing/index.md b/chapter_hashing/index.md index 46163cb77..fbd6af673 100644 --- a/chapter_hashing/index.md +++ b/chapter_hashing/index.md @@ -11,6 +11,12 @@ icon: material/table-search +!!! abstract + + 在计算机世界中,散列表如同一位智能的图书管理员。 + + 他知道如何有序地组织数据,从而可以通过索书号快速找到目标书籍。 + ## 本章内容 - [6.1 哈希表](https://www.hello-algo.com/chapter_hashing/hash_map/) diff --git a/chapter_heap/index.md b/chapter_heap/index.md index cba2ef77e..84018359d 100644 --- a/chapter_heap/index.md +++ b/chapter_heap/index.md @@ -11,6 +11,12 @@ icon: material/family-tree +!!! abstract + + 堆就像是山川的峰峦,它们层叠起伏、形态各异。 + + 每一座山峰都有其高低之分,而最高的山峰总是最先映入眼帘。 + ## 本章内容 - [8.1 堆](https://www.hello-algo.com/chapter_heap/heap/) diff --git a/chapter_introduction/index.md b/chapter_introduction/index.md index ea6636773..ae667187c 100644 --- a/chapter_introduction/index.md +++ b/chapter_introduction/index.md @@ -11,6 +11,12 @@ icon: material/calculator-variant-outline +!!! abstract + + 一位少女翩翩起舞,与数据交织在一起,裙摆上飘扬着算法的旋律。 + + 她邀请你共舞,请紧跟她的步伐,踏入充满逻辑与美感的算法世界。 + ## 本章内容 - [1.1 算法无处不在](https://www.hello-algo.com/chapter_introduction/algorithms_are_everywhere/) diff --git a/chapter_preface/index.md b/chapter_preface/index.md index 13ebb3a06..57edc51eb 100644 --- a/chapter_preface/index.md +++ b/chapter_preface/index.md @@ -11,6 +11,12 @@ icon: material/book-open-outline +!!! abstract + + 这本书是为所有想要了解并掌握算法的读者编写的。 + + 无论你的背景如何,都可以在这里找到属于你的学习之旅。 + ## 本章内容 - [0.1 关于本书](https://www.hello-algo.com/chapter_preface/about_the_book/) diff --git a/chapter_searching/index.md b/chapter_searching/index.md index e15de9bf6..a908bfa47 100644 --- a/chapter_searching/index.md +++ b/chapter_searching/index.md @@ -11,6 +11,12 @@ icon: material/text-search +!!! abstract + + 搜索是一场未知的冒险,我们或许需要走遍神秘空间的每个角落,又或许可以快速锁定目标。 + + 在这场寻觅之旅中,每一次探索都可能得到一个未曾料想的答案。 + ## 本章内容 - [10.1 二分查找](https://www.hello-algo.com/chapter_searching/binary_search/) diff --git a/chapter_sorting/index.md b/chapter_sorting/index.md index 896b29d96..8bc768aca 100644 --- a/chapter_sorting/index.md +++ b/chapter_sorting/index.md @@ -11,6 +11,12 @@ icon: material/sort-ascending +!!! abstract + + 排序犹如一把将混乱变为秩序的魔法钥匙,使我们能以更高效的方式理解与处理数据。 + + 无论是简单的升序,还是复杂的分类排列,排序都向我们展示了数据的和谐美感。 + ## 本章内容 - [11.1 排序算法](https://www.hello-algo.com/chapter_sorting/sorting_algorithm/) diff --git a/chapter_stack_and_queue/index.md b/chapter_stack_and_queue/index.md index 0f970df58..cda44a9bc 100644 --- a/chapter_stack_and_queue/index.md +++ b/chapter_stack_and_queue/index.md @@ -11,6 +11,12 @@ icon: material/stack-overflow +!!! abstract + + 栈如同叠猫猫,而队列就像猫猫排队。 + + 两者分别代表着先入后出和先入先出的逻辑关系。 + ## 本章内容 - [5.1 栈](https://www.hello-algo.com/chapter_stack_and_queue/stack/) diff --git a/chapter_tree/binary_search_tree.md b/chapter_tree/binary_search_tree.md index b06a8699a..3f4ba6218 100755 --- a/chapter_tree/binary_search_tree.md +++ b/chapter_tree/binary_search_tree.md @@ -699,7 +699,9 @@ comments: true
Fig. 在二叉搜索树中删除节点(度为 1)
-当待删除节点的度为 $2$ 时,我们无法直接删除它,而需要使用一个节点替换该节点。由于要保持二叉搜索树“左 $<$ 根 $<$ 右”的性质,因此这个节点可以是右子树的最小节点或左子树的最大节点。假设我们选择右子树的最小节点(或者称为中序遍历的下个节点),则删除操作为: +当待删除节点的度为 $2$ 时,我们无法直接删除它,而需要使用一个节点替换该节点。由于要保持二叉搜索树“左 $<$ 根 $<$ 右”的性质,因此这个节点可以是右子树的最小节点或左子树的最大节点。 + +假设我们选择右子树的最小节点(即中序遍历的下一个节点),则删除操作为: 1. 找到待删除节点在“中序遍历序列”中的下一个节点,记为 `tmp` 。 2. 将 `tmp` 的值覆盖待删除节点的值,并在树中递归删除节点 `tmp` 。 diff --git a/chapter_tree/index.md b/chapter_tree/index.md index 6899e9815..1a2ce4290 100644 --- a/chapter_tree/index.md +++ b/chapter_tree/index.md @@ -11,6 +11,12 @@ icon: material/graph-outline +!!! abstract + + 参天大树充满生命力,其根深叶茂,分枝扶疏。 + + 它为我们展现了数据分治的生动形态。 + ## 本章内容 - [7.1 二叉树](https://www.hello-algo.com/chapter_tree/binary_tree/) diff --git a/index.md b/index.md index 879ae8a1b..bacf155ff 100644 --- a/index.md +++ b/index.md @@ -84,11 +84,11 @@ hide: