From 2debd9bec200e6fed0948af246ba491c158ea78b Mon Sep 17 00:00:00 2001 From: CyC2018 Date: Sat, 7 Nov 2026 17:10:25 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Leetcode=20=E9=A2=98=E8=A7=A3=20-=20?= =?UTF-8?q?=E5=9B=BE.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 示例文本补上空格。 --- notes/Leetcode 题解 - 图.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/Leetcode 题解 - 图.md b/notes/Leetcode 题解 - 图.md index d5ff6b20..b2000dc6 100644 --- a/notes/Leetcode 题解 - 图.md +++ b/notes/Leetcode 题解 - 图.md @@ -149,7 +149,7 @@ private boolean hasCycle(boolean[] globalMarked, boolean[] localMarked, ```text 4, [[1,0],[2,0],[3,1],[3,2]] -There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0. So one correct course order is [0,1,2,3]. Another correct ordering is[0,2,1,3]. +There are a total of 4 courses to take. To take course 3 you should have finished both courses 1 and 2. Both courses 1 and 2 should be taken after you finished course 0. So one correct course order is [0,1,2,3]. Another correct ordering is [0,2,1,3]. ``` 使用 DFS 来实现拓扑排序:在一个节点的所有后继都访问完之后,再把它放入后序遍历的结果,也就是 postOrder.push(curNode) 所在的位置。