This commit is contained in:
krahets
2023-11-09 05:13:48 +08:00
parent 9701430089
commit 0105644232
83 changed files with 516 additions and 509 deletions
@@ -15,19 +15,19 @@ comments: true
3. 不断重复步骤 `1.` 和 步骤 `2.` ,直至找到拼音首字母为 $r$ 的页码为止。
=== "<1>"
![查字典步骤](algorithms_are_everywhere.assets/binary_search_dictionary_step1.png)
![查字典步骤](algorithms_are_everywhere.assets/binary_search_dictionary_step1.png){ class="animation-figure" }
=== "<2>"
![binary_search_dictionary_step2](algorithms_are_everywhere.assets/binary_search_dictionary_step2.png)
![binary_search_dictionary_step2](algorithms_are_everywhere.assets/binary_search_dictionary_step2.png){ class="animation-figure" }
=== "<3>"
![binary_search_dictionary_step3](algorithms_are_everywhere.assets/binary_search_dictionary_step3.png)
![binary_search_dictionary_step3](algorithms_are_everywhere.assets/binary_search_dictionary_step3.png){ class="animation-figure" }
=== "<4>"
![binary_search_dictionary_step4](algorithms_are_everywhere.assets/binary_search_dictionary_step4.png)
![binary_search_dictionary_step4](algorithms_are_everywhere.assets/binary_search_dictionary_step4.png){ class="animation-figure" }
=== "<5>"
![binary_search_dictionary_step5](algorithms_are_everywhere.assets/binary_search_dictionary_step5.png)
![binary_search_dictionary_step5](algorithms_are_everywhere.assets/binary_search_dictionary_step5.png){ class="animation-figure" }
<p align="center"> 图 1-1 &nbsp; 查字典步骤 </p>
@@ -39,7 +39,7 @@ comments: true
2. 在无序部分抽出一张扑克牌,插入至有序部分的正确位置;完成后最左 2 张扑克已经有序。
3. 不断循环步骤 `2.` ,每一轮将一张扑克牌从无序部分插入至有序部分,直至所有扑克牌都有序。
![扑克排序步骤](algorithms_are_everywhere.assets/playing_cards_sorting.png)
![扑克排序步骤](algorithms_are_everywhere.assets/playing_cards_sorting.png){ class="animation-figure" }
<p align="center"> 图 1-2 &nbsp; 扑克排序步骤 </p>
@@ -53,7 +53,7 @@ comments: true
4. 从剩余可选项中拿出最大的 $1$ 元,剩余 $1 - 1 = 0$ 元。
5. 完成找零,方案为 $20 + 10 + 1 = 31$ 元。
![货币找零过程](algorithms_are_everywhere.assets/greedy_change.png)
![货币找零过程](algorithms_are_everywhere.assets/greedy_change.png){ class="animation-figure" }
<p align="center"> 图 1-3 &nbsp; 货币找零过程 </p>
+1 -1
View File
@@ -7,7 +7,7 @@ icon: material/calculator-variant-outline
<div class="center-table" markdown>
![初识算法](../assets/covers/chapter_introduction.jpg){ width="600" }
![初识算法](../assets/covers/chapter_introduction.jpg){ class="cover-image" }
</div>
+2 -2
View File
@@ -33,13 +33,13 @@ comments: true
- 算法是数据结构发挥作用的舞台。数据结构本身仅存储数据信息,结合算法才能解决特定问题。
- 算法通常可以基于不同的数据结构进行实现,但执行效率可能相差很大,选择合适的数据结构是关键。
![数据结构与算法的关系](what_is_dsa.assets/relationship_between_data_structure_and_algorithm.png)
![数据结构与算法的关系](what_is_dsa.assets/relationship_between_data_structure_and_algorithm.png){ class="animation-figure" }
<p align="center"> 图 1-4 &nbsp; 数据结构与算法的关系 </p>
数据结构与算法犹如图 1-5 所示的拼装积木。一套积木,除了包含许多零件之外,还附有详细的组装说明书。我们按照说明书一步步操作,就能组装出精美的积木模型。
![拼装积木](what_is_dsa.assets/assembling_blocks.png)
![拼装积木](what_is_dsa.assets/assembling_blocks.png){ class="animation-figure" }
<p align="center"> 图 1-5 &nbsp; 拼装积木 </p>