This commit is contained in:
krahets
2023-05-21 19:29:43 +08:00
parent 0c64fc7315
commit 5a68f683b9
26 changed files with 93 additions and 93 deletions
+4 -4
View File
@@ -2,11 +2,11 @@
comments: true
---
# 10.2.   图基础操作
# 9.2.   图基础操作
图的基础操作可分为对「边」的操作和对「顶点」的操作。在「邻接矩阵」和「邻接表」两种表示方法下,实现方式有所不同。
## 10.2.1.   基于邻接矩阵的实现
## 9.2.1.   基于邻接矩阵的实现
给定一个顶点数量为 $n$ 的无向图,则有:
@@ -762,7 +762,7 @@ comments: true
```
## 10.2.2.   基于邻接表的实现
## 9.2.2.   基于邻接表的实现
设无向图的顶点总数为 $n$ 、边总数为 $m$ ,则有:
@@ -1451,7 +1451,7 @@ comments: true
[class]{GraphAdjList}-[func]{}
```
## 10.2.3.   效率对比
## 9.2.3.   效率对比
设图中共有 $n$ 个顶点和 $m$ 条边,下表为邻接矩阵和邻接表的时间和空间效率对比。