This commit is contained in:
krahets
2023-02-26 19:53:26 +08:00
parent cf26cd551a
commit 9cd475d8c2
29 changed files with 180 additions and 0 deletions
+4
View File
@@ -16,6 +16,8 @@ comments: true
![二叉树的层序遍历](binary_tree_traversal.assets/binary_tree_bfs.png)
<p align="center"> Fig. 二叉树的层序遍历 </p>
### 算法实现
广度优先遍历一般借助「队列」来实现。队列的规则是“先进先出”,广度优先遍历的规则是 ”一层层平推“ ,两者背后的思想是一致的。
@@ -256,6 +258,8 @@ comments: true
![二叉搜索树的前、中、后序遍历](binary_tree_traversal.assets/binary_tree_dfs.png)
<p align="center"> Fig. 二叉搜索树的前、中、后序遍历 </p>
<div class="center-table" markdown>
| 位置 | 含义 | 此处访问结点时对应 |