mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-24 20:16:06 +00:00
Add Dart codes to the documents. (#529)
This commit is contained in:
@@ -84,6 +84,12 @@ BFS 通常借助「队列」来实现。队列具有“先入先出”的性质
|
||||
[class]{}-[func]{graphBFS}
|
||||
```
|
||||
|
||||
=== "Dart"
|
||||
|
||||
```dart title="graph_bfs.dart"
|
||||
[class]{}-[func]{graphBFS}
|
||||
```
|
||||
|
||||
代码相对抽象,建议对照以下动画图示来加深理解。
|
||||
|
||||
=== "<1>"
|
||||
@@ -219,6 +225,14 @@ BFS 通常借助「队列」来实现。队列具有“先入先出”的性质
|
||||
[class]{}-[func]{graphDFS}
|
||||
```
|
||||
|
||||
=== "Dart"
|
||||
|
||||
```dart title="graph_dfs.dart"
|
||||
[class]{}-[func]{dfs}
|
||||
|
||||
[class]{}-[func]{graphDFS}
|
||||
```
|
||||
|
||||
深度优先遍历的算法流程如下图所示,其中:
|
||||
|
||||
- **直虚线代表向下递推**,表示开启了一个新的递归方法来访问新顶点;
|
||||
|
||||
Reference in New Issue
Block a user