Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b861d1e

Browse filesBrowse 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
Copy full SHA for b861d1e

File tree

Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-1
lines changed

‎src/graph/topological-sort.md

Copy file name to clipboardExpand all lines: src/graph/topological-sort.md
+2-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.