Content-Length: 262170 | pFad | http://github.com/cp-algorithms/cp-algorithms/commit/b861d1ec80d7e08ff7ebfc71c8cf262db65cf346

83 Update topological-sort.md · cp-algorithms/cp-algorithms@b861d1e · GitHub
Skip to content

Commit b861d1e

Browse files
Update topological-sort.md
In the implementation example, the if statement within the dfs function is missing a pair of brackets.
1 parent 5c2c8d0 commit b861d1e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/graph/topological-sort.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ vector<int> ans;
6565
void dfs(int v) {
6666
visited[v] = true;
6767
for (int u : adj[v]) {
68-
if (!visited[u])
68+
if (!visited[u]) {
6969
dfs(u);
70+
}
7071
}
7172
ans.push_back(v);
7273
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/cp-algorithms/cp-algorithms/commit/b861d1ec80d7e08ff7ebfc71c8cf262db65cf346

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy