Release Rust code to documents. (#656)

This commit is contained in:
Yudong Jin
2023-07-26 11:00:53 +08:00
committed by GitHub
parent 60162f6fa8
commit 027bdd6510
61 changed files with 1155 additions and 145 deletions

View File

@@ -90,6 +90,12 @@ BFS 通常借助「队列」来实现。队列具有“先入先出”的性质
[class]{}-[func]{graphBFS}
```
=== "Rust"
```rust title="graph_bfs.rs"
[class]{}-[func]{graph_bfs}
```
代码相对抽象,建议对照以下动画图示来加深理解。
=== "<1>"
@@ -233,6 +239,14 @@ BFS 通常借助「队列」来实现。队列具有“先入先出”的性质
[class]{}-[func]{graphDFS}
```
=== "Rust"
```rust title="graph_dfs.rs"
[class]{}-[func]{dfs}
[class]{}-[func]{graph_dfs}
```
深度优先遍历的算法流程如下图所示,其中:
- **直虚线代表向下递推**,表示开启了一个新的递归方法来访问新顶点。