From b861d1ec80d7e08ff7ebfc71c8cf262db65cf346 Mon Sep 17 00:00:00 2001 From: Franklin Date: Sat, 8 Mar 2025 02:54:08 -0500 Subject: [PATCH] Update topological-sort.md In the implementation example, the if statement within the dfs function is missing a pair of brackets. --- src/graph/topological-sort.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graph/topological-sort.md b/src/graph/topological-sort.md index f8e8e9218..acfad5331 100644 --- a/src/graph/topological-sort.md +++ b/src/graph/topological-sort.md @@ -65,8 +65,9 @@ vector ans; void dfs(int v) { visited[v] = true; for (int u : adj[v]) { - if (!visited[u]) + if (!visited[u]) { dfs(u); + } } ans.push_back(v); }