From f9d37e0d16d49e60dd3363881050e161364762d5 Mon Sep 17 00:00:00 2001
From: Yudong Jin
Date: Sun, 27 Apr 2025 16:56:24 +0800
Subject: [PATCH] Update en/README. Bug fixes. (#1742)
* Fix graph_operations.md
* Update README
* Sync zh and zh-hant versions.
---
docs/chapter_graph/graph_operations.md | 6 +++---
en/README.md | 2 +-
zh-hant/docs/chapter_graph/graph_operations.md | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/chapter_graph/graph_operations.md b/docs/chapter_graph/graph_operations.md
index abab2a86b..4ca441d37 100644
--- a/docs/chapter_graph/graph_operations.md
+++ b/docs/chapter_graph/graph_operations.md
@@ -70,15 +70,15 @@
## 效率对比
-设图中共有 $n$ 个顶点和 $m$ 条边,下表对比了邻接矩阵和邻接表的时间效率和空间效率。
+设图中共有 $n$ 个顶点和 $m$ 条边,下表对比了邻接矩阵和邻接表的时间效率和空间效率。请注意,邻接表(链表)对应本文实现,而邻接表(哈希表)专指将所有链表替换为哈希表后的实现。
表 邻接矩阵与邻接表对比
| | 邻接矩阵 | 邻接表(链表) | 邻接表(哈希表) |
| ------------ | -------- | -------------- | ---------------- |
-| 判断是否邻接 | $O(1)$ | $O(m)$ | $O(1)$ |
+| 判断是否邻接 | $O(1)$ | $O(n)$ | $O(1)$ |
| 添加边 | $O(1)$ | $O(1)$ | $O(1)$ |
-| 删除边 | $O(1)$ | $O(m)$ | $O(1)$ |
+| 删除边 | $O(1)$ | $O(n)$ | $O(1)$ |
| 添加顶点 | $O(n)$ | $O(1)$ | $O(1)$ |
| 删除顶点 | $O(n^2)$ | $O(n + m)$ | $O(n)$ |
| 内存空间占用 | $O(n^2)$ | $O(n + m)$ | $O(n + m)$ |
diff --git a/en/README.md b/en/README.md
index 04909fb45..339e78977 100644
--- a/en/README.md
+++ b/en/README.md
@@ -4,7 +4,7 @@
-
+
Data structures and algorithms crash course with animated illustrations and off-the-shelf code
diff --git a/zh-hant/docs/chapter_graph/graph_operations.md b/zh-hant/docs/chapter_graph/graph_operations.md
index 366ff1290..08d964048 100644
--- a/zh-hant/docs/chapter_graph/graph_operations.md
+++ b/zh-hant/docs/chapter_graph/graph_operations.md
@@ -70,15 +70,15 @@
## 效率對比
-設圖中共有 $n$ 個頂點和 $m$ 條邊,下表對比了鄰接矩陣和鄰接表的時間效率和空間效率。
+設圖中共有 $n$ 個頂點和 $m$ 條邊,下表對比了鄰接矩陣和鄰接表的時間效率和空間效率。請注意,鄰接表(鏈結串列)對應本文實現,而鄰接表(雜湊表)專指將所有鏈結串列替換為雜湊表後的實現。
表 鄰接矩陣與鄰接表對比
| | 鄰接矩陣 | 鄰接表(鏈結串列) | 鄰接表(雜湊表) |
| ------------ | -------- | -------------- | ---------------- |
-| 判斷是否鄰接 | $O(1)$ | $O(m)$ | $O(1)$ |
+| 判斷是否鄰接 | $O(1)$ | $O(n)$ | $O(1)$ |
| 新增邊 | $O(1)$ | $O(1)$ | $O(1)$ |
-| 刪除邊 | $O(1)$ | $O(m)$ | $O(1)$ |
+| 刪除邊 | $O(1)$ | $O(n)$ | $O(1)$ |
| 新增頂點 | $O(n)$ | $O(1)$ | $O(1)$ |
| 刪除頂點 | $O(n^2)$ | $O(n + m)$ | $O(n)$ |
| 記憶體空間佔用 | $O(n^2)$ | $O(n + m)$ | $O(n + m)$ |