mirror of
https://github.com/krahets/hello-algo.git
synced 2025-12-19 07:17:54 +08:00
Number the H1 and H2 headings.
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
comments: true
|
||||
---
|
||||
|
||||
# 二叉树遍历
|
||||
# 7.2. 二叉树遍历
|
||||
|
||||
非线性数据结构的遍历操作比线性数据结构更加复杂,往往需要使用搜索算法来实现。常见的二叉树遍历方式有层序遍历、前序遍历、中序遍历、后序遍历。
|
||||
|
||||
## 层序遍历
|
||||
## 7.2.1. 层序遍历
|
||||
|
||||
「层序遍历 Hierarchical-Order Traversal」从顶至底、一层一层地遍历二叉树,并在每层中按照从左到右的顺序访问结点。
|
||||
|
||||
@@ -208,7 +208,7 @@ comments: true
|
||||
}
|
||||
```
|
||||
|
||||
## 前序、中序、后序遍历
|
||||
## 7.2.2. 前序、中序、后序遍历
|
||||
|
||||
相对地,前、中、后序遍历皆属于「深度优先遍历 Depth-First Traversal」,其体现着一种“先走到尽头,再回头继续”的回溯遍历方式。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user