mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-27 12:01:49 +08:00
Add Dart codes to the documents. (#529)
This commit is contained in:
@@ -88,6 +88,12 @@
|
||||
|
||||
```
|
||||
|
||||
=== "Dart"
|
||||
|
||||
```dart title="graph_adjacency_matrix.dart"
|
||||
[class]{GraphAdjMat}-[func]{}
|
||||
```
|
||||
|
||||
## 基于邻接表的实现
|
||||
|
||||
设无向图的顶点总数为 $n$ 、边总数为 $m$ ,则有:
|
||||
@@ -179,6 +185,12 @@
|
||||
[class]{GraphAdjList}-[func]{}
|
||||
```
|
||||
|
||||
=== "Dart"
|
||||
|
||||
```dart title="graph_adjacency_list.dart"
|
||||
[class]{GraphAdjList}-[func]{}
|
||||
```
|
||||
|
||||
## 效率对比
|
||||
|
||||
设图中共有 $n$ 个顶点和 $m$ 条边,下表为邻接矩阵和邻接表的时间和空间效率对比。
|
||||
|
||||
Reference in New Issue
Block a user