Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitb861d1e

Browse files
Update topological-sort.md
In the implementation example, the if statement within the dfs function is missing a pair of brackets.
1 parent5c2c8d0 commitb861d1e

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
voiddfs(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)

[8]ページ先頭

©2009-2025 Movatter.jp