mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-11 23:16:07 +00:00
Add Dart codes to the documents. (#529)
This commit is contained in:
@@ -76,6 +76,12 @@
|
||||
[class]{}-[func]{levelOrder}
|
||||
```
|
||||
|
||||
=== "Dart"
|
||||
|
||||
```dart title="binary_tree_bfs.dart"
|
||||
[class]{}-[func]{levelOrder}
|
||||
```
|
||||
|
||||
### 复杂度分析
|
||||
|
||||
**时间复杂度**:所有节点被访问一次,使用 $O(n)$ 时间,其中 $n$ 为节点数量。
|
||||
@@ -202,6 +208,16 @@
|
||||
[class]{}-[func]{postOrder}
|
||||
```
|
||||
|
||||
=== "Dart"
|
||||
|
||||
```dart title="binary_tree_dfs.dart"
|
||||
[class]{}-[func]{preOrder}
|
||||
|
||||
[class]{}-[func]{inOrder}
|
||||
|
||||
[class]{}-[func]{postOrder}
|
||||
```
|
||||
|
||||
!!! note
|
||||
|
||||
我们也可以仅基于循环实现前、中、后序遍历,有兴趣的同学可以自行实现。
|
||||
|
||||
Reference in New Issue
Block a user