From 723096c13b1e0a4aeadeb56ac0155f4113d67641 Mon Sep 17 00:00:00 2001 From: IsshikiHugh Date: Sat, 17 Aug 2024 20:01:42 -0500 Subject: [PATCH] chore: clear --- .../plugin/git-committers/page-authors.json | 2 +- docs/5-x.md | 48 +++++++------- docs/6-x.md | 16 ++--- docs/7-x.md | 28 ++++----- docs/8-x.md | 18 +++--- docs/9-x.md | 62 +++++++++---------- 6 files changed, 77 insertions(+), 97 deletions(-) diff --git a/.cache/plugin/git-committers/page-authors.json b/.cache/plugin/git-committers/page-authors.json index e8073d8..6815533 100644 --- a/.cache/plugin/git-committers/page-authors.json +++ b/.cache/plugin/git-committers/page-authors.json @@ -1 +1 @@ -{"cache_date": "2024-08-13", "page_authors": {"docs/index.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}, {"login": "IsshikiHugh", "name": "IsshikiHugh", "url": "https://github.com/IsshikiHugh", "avatar": "https://avatars.githubusercontent.com/u/48550237?v=4"}]}, "docs/2-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/3-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/4-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/5-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/6-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/7-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/8-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/9-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}}} \ No newline at end of file +{"cache_date": "2024-08-17", "page_authors": {"docs/index.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}, {"login": "IsshikiHugh", "name": "IsshikiHugh", "url": "https://github.com/IsshikiHugh", "avatar": "https://avatars.githubusercontent.com/u/48550237?v=4"}]}, "docs/2-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/3-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/4-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/5-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/6-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/7-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/8-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}, "docs/9-x.md": {"last_commit_date": "2024-08-10", "authors": [{"login": "NoughtQ", "name": "NoughtQ", "url": "https://github.com/NoughtQ", "avatar": "https://avatars.githubusercontent.com/u/88835299?v=4"}]}}} \ No newline at end of file diff --git a/docs/5-x.md b/docs/5-x.md index a0ebea7..80c7826 100644 --- a/docs/5-x.md +++ b/docs/5-x.md @@ -1,7 +1,3 @@ ---- -counter: True ---- - # Chap 5 Hashing ??? abstract "核心知识" @@ -147,9 +143,9 @@ $$ }; typedef Position List; - /* List *TheList will be an array of lists, allocated later */ - /* The lists use headers (for simplicity), */ - /* though this wastes space */ + /* List *TheList will be an array of lists, allocated later */ + /* The lists use headers (for simplicity), */ + /* though this wastes space */ struct HashTbl { int TableSize; @@ -158,7 +154,7 @@ $$ ``` + 创建空表 - + ``` c HashTable InitializeTable(int TableSize) { @@ -170,21 +166,21 @@ $$ return NULL; } H = (HashTable)malloc(sizeof(struct HashTbl)); // Allocate table - if (H == NULL) + if (H == NULL) FatalError("Out of Space!!!"); H->TableSize = NextPrime(TableSize); // Better be prime H->TheLists = malloc(sizeof(List) * H->TableSize); // Array of lists - if (H->TheLists == NULL) - FatalError("Out of space!!!"); - for(i = 0; i < H->TableSize; i++) + if (H->TheLists == NULL) + FatalError("Out of space!!!"); + for(i = 0; i < H->TableSize; i++) { // Allocate list headers - H->TheLists[i] = malloc(sizeof(struct ListNode)); // Slow! - if ( H->TheLists[i] == NULL ) - FatalError("Out of space!!!"); - else + H->TheLists[i] = malloc(sizeof(struct ListNode)); // Slow! + if ( H->TheLists[i] == NULL ) + FatalError("Out of space!!!"); + else H->TheLists[i]->Next = NULL; - } - return H; + } + return H; } ``` @@ -197,7 +193,7 @@ $$ 注意:散列表的开头,以及每个篮子都是有"空头"的,这主要是为了删除操作的方便。若没有删除操作,则最好不要用空头,这样可以节省空间 + 从散列表中找键 - + ``` c Position Find(ElementType Key, HashTable H) { @@ -215,7 +211,7 @@ $$ ``` + 将键插入散列表内(放在篮子的最上(前)面) - + ``` c void Insert(ElementType Key, HashTable H) { @@ -277,14 +273,14 @@ Algorithm: insert key into an array of hash table 最简单的冲突解决函数为**线性探测(linear probing)**:f(i) = i,它仅是一个线性函数 -!!! example +!!! example
对比[前面的例子](#general-idea),可以发现:虽然加载密度得到不小的提升,但是平均搜索时间比较长。 - + 线性探测中预期探测次数关于加载密度的表达式: $$ @@ -414,12 +410,12 @@ $$ Position CurrentPos; int CollisionNum = 0; CurrentPos = Hash(Key, H->TableSize); - while (H->TheCells[CurrentPos].Info != Empty && - H->TheCells[CurrentPos].Element != Key) + while (H->TheCells[CurrentPos].Info != Empty && + H->TheCells[CurrentPos].Element != Key) { CurrentPos += 2 * ++CollisionNum - 1; // 1 if (CurrentPos >= H->TableSize) // 2 - CurrentPos -= H->TableSize; + CurrentPos -= H->TableSize; } return CurrentPos; // 3 } @@ -502,7 +498,7 @@ $$ for (i = 0; i < OldSize; i++) if (OldCells[i].Info == Legitimate) Insert(OldCells[i].Element, H); - + free(OldCells); return H; diff --git a/docs/6-x.md b/docs/6-x.md index e966f61..6426f57 100644 --- a/docs/6-x.md +++ b/docs/6-x.md @@ -1,7 +1,3 @@ ---- -counter: True ---- - # Chap 6 Priority Queues(Heaps) ??? abstract "核心知识" @@ -39,7 +35,7 @@ counter: True + 虽然理论上它的插入和删除操作时间复杂度为$O(\log n)$,然而实际应用中**插入**操作是**随机**的,这会导致树的不平衡,从而影响时间复杂度 + 虽然**删除**操作并不是随机的,但我们只要找最小节点并且删除它,这会导致左子树越来越小,破坏了树的平衡,从而影响复杂度 - + 我们可能想到构建一棵平衡的树,比如 AVL 树。但是 AVL 树中的很多操作在优先队列中用不到,且它的指针使用很危险。 + + 我们可能想到构建一棵平衡的树,比如 AVL 树。但是 AVL 树中的很多操作在优先队列中用不到,且它的指针使用很危险。 ## ADT Model @@ -144,7 +140,7 @@ PriorityQueue Initiailize(int MaxElments) + 插入以后要调整节点的位置: + 将该节点与其父节点比较,如果比父节点小,则将父节点往下移 + 重复该步骤,直至比当前比较的节点更大则停止,此时的位置即为新节点的位置 - + 这种技巧被称为“**上滤(percolate up)**”。 ???+ play "动画演示" @@ -191,7 +187,7 @@ PriorityQueue Initiailize(int MaxElments) + 先将它放入根节点的位置(因为”删除“操作,这个位置空出来了),再让它和左右孩子比较 + 如果比左右孩子都大,则要将最小的孩子放入根节点 + 接着将它与这个孩子的左右孩子比较,……,直至比左右孩子都小为止 - + 这种技巧被称为“**下滤(percolate down)**”。 ???+ play "动画演示" @@ -311,7 +307,7 @@ for (i = N / 2; i > 0; i--) ### The Selection Problem !!! question "问题" - + 给定$N$个元素,找到第$k$大的元素 !!! note "算法" @@ -325,7 +321,7 @@ for (i = N / 2; i > 0; i--) === "算法2" 先取前$k$个数并对这些数排好序,再将剩余 $N - k$ 个数分别与这 $k$ 个数比较:如果比这 $k$ 个数中最小的数更大,将最小的数踢出去,让待判断的数进去并放入正确的位置。 - + 时间复杂度为 $O(N \cdot k)$。最坏情况 $k = \lceil N/2 \rceil$ 时,时间复杂度为 $O(N^2)$ --- @@ -354,7 +350,7 @@ for (i = N / 2; i > 0; i--) 如果我们通过循环每个 tick 来处理整个程序的话,那么运行时间跟顾客和时间的数量无关,而且运行效率很低。因此我们**根据最近时间发生的事件来增加 tick**,这分为两种情况:下一位顾客的到来,有一位顾客离开。 对于正在排队的顾客,我们用**队列**来存储;对于每位顾客离开时间的存储,我们用**优先队列**存储,以便我们找到最近发生的事件。 - + 时间复杂度:$O(C \log(k + 1))$ ## d-Heaps diff --git a/docs/7-x.md b/docs/7-x.md index 95c5cad..79a6ae5 100644 --- a/docs/7-x.md +++ b/docs/7-x.md @@ -1,7 +1,3 @@ ---- -counter: True ---- - # Chap 7 Sorting ??? abstract "核心知识" @@ -305,11 +301,11 @@ T(1) &= 1 \notag \\ T(N) &= 2T(\dfrac{N}{2}) + O(N) \notag \\ & = 2^kT(\dfrac{N}{2^k}) + k \cdot O(N) \notag \\ & = N \cdot T(1) + \log N \cdot O(N) \notag \\ -& =O(N + N\log N) \notag +& =O(N + N\log N) \notag \end{align} $$ ->注:另一种证明法见书本$P_{233-234}$ +>注:另一种证明法见书本$P_{233-234}$ 归并排序需要线性大小的额外内存,且拷贝数组会降低速度,因此在**内部排序**中这种方法不太好用,但是在**外部排序(external sort)**(ads 会讲)中很合适 @@ -322,13 +318,13 @@ $$ ??? code "代码实现" 可以用来打印每一趟归并排序后的结果 - + ```c void merge_sort( ElementType list[], int N ) { ElementType extra[MAXN]; /* the extra space required */ int length = 1; /* current length of sublist being merged */ - while( length < N ) { + while( length < N ) { merge_pass( list, extra, N, length ); /* merge list into extra */ output( extra, N ); length *= 2; @@ -358,9 +354,9 @@ $$ while (ptr_l < i + length) sorted[ptr++] = list[ptr_l++]; while (ptr_r < i + 2 * length && ptr_r < N) - sorted[ptr++] = list[ptr_r++]; + sorted[ptr++] = list[ptr_r++]; } - } + } void output( ElementType list[], int N ) { @@ -499,8 +495,8 @@ void Quicksort(ElementType A[], int N) else break; // partition done } Swap(&A[i], &A[Right - 1]); // restore pivot - Qsort(A, Left, i - 1); // recursively sort left part - Qsort(A, i + 1, Right); // recursively sort right part + Qsort(A, Left, i - 1); // recursively sort left part + Qsort(A, i + 1, Right); // recursively sort right part } // end if - the sequence subarray else InsertionSort(A + Left, Right - Left + 1); @@ -589,7 +585,7 @@ $$T(N) = \dfrac{2}{N}[\sum\limits_{j = 0}^{N - 1}T(j)] + cN \quad \Rightarrow \q else if (k > i + 1) Qselect(A, k, i + 1, Right); } - else + else InsertionSort(A + Left, Right - Left + 1); } ``` @@ -644,7 +640,7 @@ $$T(N) = \dfrac{2}{N}[\sum\limits_{j = 0}^{N - 1}T(j)] + cN \quad \Rightarrow \q 最坏情况:有 $\lfloor \dfrac{N}{2} \rfloor$ 个环,需要 $\lfloor \dfrac{3N}{2} \rfloor$ 次移动 - + 时间复杂度:$T = O(mN)$,其中 m 为结构体的大小 ## General Lower Bound for Sorting @@ -742,7 +738,7 @@ s === "法一:最高位排序" - + + 按 $K^0$ 排序:根据花色,创建 4 个篮子
@@ -754,7 +750,7 @@ s
- + === "法二:最低位排序" + 按 $K^1$ 排序,根据面值,创建13个篮子 diff --git a/docs/8-x.md b/docs/8-x.md index 741bc19..4ddf772 100644 --- a/docs/8-x.md +++ b/docs/8-x.md @@ -1,7 +1,3 @@ ---- -counter: True ---- - # Chap 8 The Disjoint Set ADT ??? abstract "核心知识" @@ -48,7 +44,7 @@ counter: True ``` c Algorithm: (Union / Find) -{ +{ // step 1: read the relations in initialize N disjoint sets; while (read in a~b) @@ -132,7 +128,7 @@ SetType Find(ElementType X, DisjSet S);
- + 代码实现: ``` c @@ -191,7 +187,7 @@ void SetUnion(DisSet S, SetType Rt1, SetType Rt2) Initialize S[i] = {i} for i = 1,..., 12; for (k = 1; k <= Size; k++) // 对于每一对i~j if (Find(i) != Find(j)) - SetUnion(Find(i), Find(j)); + SetUnion(Find(i), Find(j)); } ``` @@ -286,7 +282,7 @@ void SetUnion(DisjSet S, SetType Root1, SetType Root2) else // 让 X 的父节点为 X 原来父节点的父节点,这样的最终效果是: // 从根节点到 X 的路径上,除根节点外的所有节点的父节点均为根节点,实现路径压缩 - return S[X] = Find(S[X], S); + return S[X] = Find(S[X], S); } ``` @@ -298,7 +294,7 @@ void SetUnion(DisjSet S, SetType Root1, SetType Root2) { ElementType root, trail, lead; // trail 表示当前处理的节点,lead 表示下一个要处理的节点 for (root = X; S[root] > 0; root = S[root]); // find the root - for (trail = X; trail != root; trail = lead) + for (trail = X; trail != root; trail = lead) // 将路径上的所有节点的父节点都设为根节点 { lead = S[trail]; @@ -321,10 +317,10 @@ k_1M \alpha(M, N) \le T(M, N) \le k_2M \alpha(M, N) $$ 即并查集最坏情况的时间复杂度为:$\Theta(M\alpha (M, N))$ -**阿克曼函数(Ackermann's Function)**:$\alpha (M, N)$ +**阿克曼函数(Ackermann's Function)**:$\alpha (M, N)$ $$ -A(i, j) = +A(i, j) = \begin{cases} 2^j & i = 1 \text{ and } j \ge 1 \\ A(i - 1, 2) & i \ge 2 \text{ and } j = 1 \\ diff --git a/docs/9-x.md b/docs/9-x.md index f276e1a..8a501a0 100644 --- a/docs/9-x.md +++ b/docs/9-x.md @@ -1,7 +1,3 @@ ---- -counter: True ---- - # Chap 9 Graph Algorithm ??? abstract "核心知识" @@ -63,15 +59,15 @@ counter: True
-
- +
+ + **邻接(adjacent)** + 无向图:如果$(v_i, v_j)$存在,则称$v_i, v_j$是*邻接的*
-
+ + 有向图:如果$$存在,则称$v_i$ to $v_j$是*邻接的*,或者说$v_j$ from $v_i$是*邻接的* @@ -110,7 +106,7 @@ counter: True 假如 $G$ 有 $v$ 个顶点和 $e$ 条边,那么 $e = \dfrac{\sum\limits_{i = 0}^{n - 1}d_i}{2}$,其中 $d_i = \text{degree}(v_i)$([握手定理](https://note.noughtq.top/math/dm/10#basic-terminology)) - + 对于有向图而言,所有顶点入度之和 = 所有顶点出度之和 ### Representation of Graph @@ -301,7 +297,7 @@ $adj\_mat[n(n+1)/2] = \{a_{11}, a_{21}, \dots, a_{n1}, \dots, a_{nn}\}$,其中 -??? code "代码实现" +??? code "代码实现" ``` c // version 2, using queue ADT @@ -310,10 +306,10 @@ $adj\_mat[n(n+1)/2] = \{a_{11}, a_{21}, \dots, a_{n1}, \dots, a_{nn}\}$,其中 Queue Q; int Counter = 0; Vertex V, W; - - Q = CreateQueue(NumVertex); + + Q = CreateQueue(NumVertex); for (each vertex V) - if (indegree[V] == 0) + if (indegree[V] == 0) Enqueue(V, Q); while (!isEmpty(Q)) { @@ -548,7 +544,7 @@ $adj\_mat[n(n+1)/2] = \{a_{11}, a_{21}, \dots, a_{n1}, \dots, a_{nn}\}$,其中 if (!T[W].Known) if(T[V].Dist + Cvw < T[W].Dist) // 这步操作称为“松弛” { - Decrease(T[W].Dist to T[V].Dist + Cvw); + Decrease(T[W].Dist to T[V].Dist + Cvw); T[W].Path = V; } // end-if update W } // end-for(;;) @@ -574,20 +570,20 @@ Dijkstra 算法的运行时间取决于我们如何寻找距离最短且未 === "方法2" 将距离保存在**堆**里,调用 `DeleteMin` 来找到未标记的最小顶点,并且之后不去管它。 - + 那么如何实现算法中的 `Decrease(T[W].Dist to T[V].Dist + Cvw);` 呢? - + === "法1" - + `DecreaseKey()` $\rightarrow O(\log |V|)$,因此$T = O(|V|\log |V| + |E| \log |V|) = O(|E|\log |V|)$,适用于*稀疏图* - + 但是,因为堆不能有效支持 `Find` 操作,当 $d_i$ 的值发生改变时,它的位置需要维护和更新,用二叉堆实现起来有些麻烦。 - + >如果用到[**配对堆(pairing heap)**](https://oi-wiki.org/ds/pairing-heap/),情况就会改善,这种改进不做要求 === "法2" - + 将更新后的 $d_w$ 插入堆中,这样的话堆内就会出现多个表示同一顶点的距离。因此在 `V = smallest unknown distance vertex;` 这一句中,要重复使用 `DeleteMin`,直到未标记的点出现(标记过的点就扔掉不用)。虽然这种方法会扩大堆的规模($O(|E|)$),但是因为 $|E| \le |V|^2$。所以 $\log |E| \le 2\log |V|$,因此 $T = O(|E| \log |V|)$。但它占用空间大于法 1 需要 $|E|$ 次 `DeleteMin` 操作,因此在实际运行中可能会变慢。 >其他改进方法:[斐波那契堆(Fibonacci heap)](https://zh.wikipedia.org/wiki/%E6%96%90%E6%B3%A2%E9%82%A3%E5%A5%91%E5%A0%86) @@ -595,7 +591,7 @@ Dijkstra 算法的运行时间取决于我们如何寻找距离最短且未 ??? code "具体实现" ``` c - void Dijkstra(VType s, Table T, int n) // Finding all the shortest paths + void Dijkstra(VType s, Table T, int n) // Finding all the shortest paths { VType V, W; // V: the current vertex; W: the vertex adjacent to V Heap H; // A heap maintaining the shortest unknown vertex @@ -631,11 +627,11 @@ Dijkstra 算法的运行时间取决于我们如何寻找距离最短且未 T[W].Path = tmp; } else if (len == T[W].Dist) // If the new distance is equal to the old one, then just involve the new solution - { - tmp = (Vertex)malloc(sizeof(struct node)); // The same operations + { + tmp = (Vertex)malloc(sizeof(struct node)); // The same operations tmp->vertex = V; tmp->next = T[W].Path; - T[W].Path = tmp; + T[W].Path = tmp; } } cur = cur->next; // Finding the next one @@ -857,15 +853,15 @@ $$ === "法1" 在选择增广路径时,总是挑选**对流量提升最大**的路径 - + 如何实现:稍微改变一下 Dijkstra 算法 时间复杂度: - + $$ \begin{align} T = & T_{augmentation} \cdot T_{find\ a\ path} \notag \\ - = & O(|E| \log cap_{max}) \cdot O(|E|\log |V|) \notag \\ + = & O(|E| \log cap_{max}) \cdot O(|E|\log |V|) \notag \\ = & O(|E|^2 \log |V|) (\text{if } cap_{max} \text{ is a small integer}) \notag \end{align} $$ @@ -873,12 +869,12 @@ $$ === "法2" 在选择增广路径时,挑选**边最少**的增广路径 - + 时间复杂度: - + $$ \begin{align} - T = & T_{augmentation} \cdot T_{find\ a\ path} \notag \\ + T = & T_{augmentation} \cdot T_{find\ a\ path} \notag \\ = & O(|E|) \cdot O(|E| \cdot |V|)\quad (\text{unweighted shortest path algorithm}) \notag \\ = & O(|E|^2 |V|) \notag \end{align} @@ -958,7 +954,7 @@ $$ * * w_adj_mat: the weighted adjacency matrix * n: the number of vertices - * + * * returns: the total edge weights of the MST */ int prim(int w_adj_mat[MAX][MAX], int n) @@ -1309,7 +1305,7 @@ void ListComponents(Graph G) #define SIZE 201 #define PSIZE 2001 - typedef struct AdjVNode *PtrToAdjVNode; + typedef struct AdjVNode *PtrToAdjVNode; struct AdjVNode{ int AdjV; PtrToAdjVNode Next; @@ -1320,7 +1316,7 @@ void ListComponents(Graph G) } AdjList[SIZE]; typedef struct GNode *PtrToGNode; - struct GNode{ + struct GNode{ int Nv; int Ne; AdjList G; @@ -1409,5 +1405,5 @@ void ListComponents(Graph G) } printf("YES\n"); } - } + } ```