mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-13 18:00:18 +08:00
Number the H1 and H2 headings.
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
comments: true
|
||||
---
|
||||
|
||||
# 图基础操作
|
||||
# 9.2. 图基础操作
|
||||
|
||||
图的基础操作分为对「边」的操作和对「顶点」的操作,在「邻接矩阵」和「邻接表」这两种表示下的实现方式不同。
|
||||
|
||||
## 基于邻接矩阵的实现
|
||||
## 9.2.1. 基于邻接矩阵的实现
|
||||
|
||||
设图的顶点总数为 $n$ ,则有:
|
||||
|
||||
@@ -162,7 +162,7 @@ comments: true
|
||||
|
||||
```
|
||||
|
||||
## 基于邻接表的实现
|
||||
## 9.2.2. 基于邻接表的实现
|
||||
|
||||
设图的顶点总数为 $n$ 、边总数为 $m$ ,则有:
|
||||
|
||||
@@ -309,7 +309,7 @@ comments: true
|
||||
|
||||
```
|
||||
|
||||
## 效率对比
|
||||
## 9.2.3. 效率对比
|
||||
|
||||
设图中共有 $n$ 个顶点和 $m$ 条边,下表为邻接矩阵和邻接表的时间和空间效率对比。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user