mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-13 13:19:46 +08:00
Add Zig code blocks.
This commit is contained in:
@@ -208,6 +208,12 @@ comments: true
|
||||
}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="binary_tree_bfs.zig"
|
||||
|
||||
```
|
||||
|
||||
## 7.2.2. 前序、中序、后序遍历
|
||||
|
||||
相对地,前、中、后序遍历皆属于「深度优先遍历 Depth-First Traversal」,其体现着一种“先走到尽头,再回头继续”的回溯遍历方式。
|
||||
@@ -503,6 +509,12 @@ comments: true
|
||||
}
|
||||
```
|
||||
|
||||
=== "Zig"
|
||||
|
||||
```zig title="binary_tree_dfs.zig"
|
||||
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
使用循环一样可以实现前、中、后序遍历,但代码相对繁琐,有兴趣的同学可以自行实现。
|
||||
|
||||
Reference in New Issue
Block a user