From 64517f2f46f4686dd26aca5783ba531c1939bb92 Mon Sep 17 00:00:00 2001 From: Yudong Jin Date: Fri, 3 Feb 2023 01:12:37 +0800 Subject: [PATCH] Update graph operations. --- .../adjacency_list_add_edge.png | Bin .../adjacency_list_add_vertex.png | Bin .../adjacency_list_initialization.png | Bin .../adjacency_list_remove_edge.png | Bin .../adjacency_list_remove_vertex.png | Bin .../adjacency_matrix_add_edge.png | Bin .../adjacency_matrix_add_vertex.png | Bin .../adjacency_matrix_initialization.png | Bin .../adjacency_matrix_remove_edge.png | Bin .../adjacency_matrix_remove_vertex.png | Bin ...ration_of_graph.md => graph_operations.md} | 20 +++++++++--------- docs/index.md | 8 ++++--- mkdocs.yml | 2 +- 13 files changed, 16 insertions(+), 14 deletions(-) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_list_add_edge.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_list_add_vertex.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_list_initialization.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_list_remove_edge.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_list_remove_vertex.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_matrix_add_edge.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_matrix_add_vertex.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_matrix_initialization.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_matrix_remove_edge.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.assets => graph_operations.assets}/adjacency_matrix_remove_vertex.png (100%) rename docs/chapter_graph/{basic_operation_of_graph.md => graph_operations.md} (90%) diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_add_edge.png b/docs/chapter_graph/graph_operations.assets/adjacency_list_add_edge.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_add_edge.png rename to docs/chapter_graph/graph_operations.assets/adjacency_list_add_edge.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_add_vertex.png b/docs/chapter_graph/graph_operations.assets/adjacency_list_add_vertex.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_add_vertex.png rename to docs/chapter_graph/graph_operations.assets/adjacency_list_add_vertex.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_initialization.png b/docs/chapter_graph/graph_operations.assets/adjacency_list_initialization.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_initialization.png rename to docs/chapter_graph/graph_operations.assets/adjacency_list_initialization.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_remove_edge.png b/docs/chapter_graph/graph_operations.assets/adjacency_list_remove_edge.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_remove_edge.png rename to docs/chapter_graph/graph_operations.assets/adjacency_list_remove_edge.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_remove_vertex.png b/docs/chapter_graph/graph_operations.assets/adjacency_list_remove_vertex.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_list_remove_vertex.png rename to docs/chapter_graph/graph_operations.assets/adjacency_list_remove_vertex.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_add_edge.png b/docs/chapter_graph/graph_operations.assets/adjacency_matrix_add_edge.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_add_edge.png rename to docs/chapter_graph/graph_operations.assets/adjacency_matrix_add_edge.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_add_vertex.png b/docs/chapter_graph/graph_operations.assets/adjacency_matrix_add_vertex.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_add_vertex.png rename to docs/chapter_graph/graph_operations.assets/adjacency_matrix_add_vertex.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_initialization.png b/docs/chapter_graph/graph_operations.assets/adjacency_matrix_initialization.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_initialization.png rename to docs/chapter_graph/graph_operations.assets/adjacency_matrix_initialization.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_remove_edge.png b/docs/chapter_graph/graph_operations.assets/adjacency_matrix_remove_edge.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_remove_edge.png rename to docs/chapter_graph/graph_operations.assets/adjacency_matrix_remove_edge.png diff --git a/docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_remove_vertex.png b/docs/chapter_graph/graph_operations.assets/adjacency_matrix_remove_vertex.png similarity index 100% rename from docs/chapter_graph/basic_operation_of_graph.assets/adjacency_matrix_remove_vertex.png rename to docs/chapter_graph/graph_operations.assets/adjacency_matrix_remove_vertex.png diff --git a/docs/chapter_graph/basic_operation_of_graph.md b/docs/chapter_graph/graph_operations.md similarity index 90% rename from docs/chapter_graph/basic_operation_of_graph.md rename to docs/chapter_graph/graph_operations.md index 8152e21a6..50b05f2eb 100644 --- a/docs/chapter_graph/basic_operation_of_graph.md +++ b/docs/chapter_graph/graph_operations.md @@ -16,19 +16,19 @@ comments: true - **初始化**:传入 $n$ 个顶点,初始化长度为 $n$ 的顶点列表 `vertices` ,使用 $O(n)$ 时间;初始化 $n \times n$ 大小的邻接矩阵 `adjMat` ,使用 $O(n^2)$ 时间。 === "初始化邻接矩阵" - ![adjacency_matrix_initialization](basic_operation_of_graph.assets/adjacency_matrix_initialization.png) + ![adjacency_matrix_initialization](graph_operations.assets/adjacency_matrix_initialization.png) === "添加边" - ![adjacency_matrix_add_edge](basic_operation_of_graph.assets/adjacency_matrix_add_edge.png) + ![adjacency_matrix_add_edge](graph_operations.assets/adjacency_matrix_add_edge.png) === "删除边" - ![adjacency_matrix_remove_edge](basic_operation_of_graph.assets/adjacency_matrix_remove_edge.png) + ![adjacency_matrix_remove_edge](graph_operations.assets/adjacency_matrix_remove_edge.png) === "添加顶点" - ![adjacency_matrix_add_vertex](basic_operation_of_graph.assets/adjacency_matrix_add_vertex.png) + ![adjacency_matrix_add_vertex](graph_operations.assets/adjacency_matrix_add_vertex.png) === "删除顶点" - ![adjacency_matrix_remove_vertex](basic_operation_of_graph.assets/adjacency_matrix_remove_vertex.png) + ![adjacency_matrix_remove_vertex](graph_operations.assets/adjacency_matrix_remove_vertex.png) 以下是基于邻接矩阵表示图的实现代码。 @@ -179,19 +179,19 @@ comments: true - **初始化**:需要在邻接表中建立 $n$ 个结点和 $2m$ 条边,使用 $O(n + m)$ 时间。 === "初始化邻接表" - ![adjacency_list_initialization](basic_operation_of_graph.assets/adjacency_list_initialization.png) + ![adjacency_list_initialization](graph_operations.assets/adjacency_list_initialization.png) === "添加边" - ![adjacency_list_add_edge](basic_operation_of_graph.assets/adjacency_list_add_edge.png) + ![adjacency_list_add_edge](graph_operations.assets/adjacency_list_add_edge.png) === "删除边" - ![adjacency_list_remove_edge](basic_operation_of_graph.assets/adjacency_list_remove_edge.png) + ![adjacency_list_remove_edge](graph_operations.assets/adjacency_list_remove_edge.png) === "添加顶点" - ![adjacency_list_add_vertex](basic_operation_of_graph.assets/adjacency_list_add_vertex.png) + ![adjacency_list_add_vertex](graph_operations.assets/adjacency_list_add_vertex.png) === "删除顶点" - ![adjacency_list_remove_vertex](basic_operation_of_graph.assets/adjacency_list_remove_vertex.png) + ![adjacency_list_remove_vertex](graph_operations.assets/adjacency_list_remove_vertex.png) 基于邻接表实现图的代码如下所示。 diff --git a/docs/index.md b/docs/index.md index 3b6405202..0ab257690 100644 --- a/docs/index.md +++ b/docs/index.md @@ -68,8 +68,10 @@ hide: 感谢本开源书的每一位撰稿人,是他们的无私奉献让这本书变得更好,他们是: - - - +

+ + + +

--- diff --git a/mkdocs.yml b/mkdocs.yml index 7ec072cd7..370745720 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -165,7 +165,7 @@ nav: - 8.1. 堆(Heap): chapter_heap/heap.md - 9. 图: - 9.1. 图(Graph): chapter_graph/graph.md - - 9.2. 图基础操作: chapter_graph/basic_operation_of_graph.md + - 9.2. 图基础操作: chapter_graph/graph_operations.md - 10. 查找算法: - 10.1. 线性查找: chapter_searching/linear_search.md - 10.2. 二分查找: chapter_searching/binary_search.md