Skip to content

Commit 1b07f21

Browse files
committed
Fix DFS algorithm
1 parent c05f08d commit 1b07f21

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

algorithms/dfs/dfs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
std::vector<bool> &dfs(
44
const std::vector<std::vector<int64_t>> &graph,
55
std::vector<bool> &reachable,
6-
int node
6+
int64_t node
77
) {
88
reachable[node] = true;
9-
for (int neighbour : graph[node]) {
9+
for (int64_t neighbour : graph[node]) {
1010
if (false == reachable[neighbour]) {
1111
dfs(graph, reachable, neighbour);
1212
}

algorithms/dfs/dfs.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
std::vector<bool> &dfs(
55
const std::vector<std::vector<int64_t>> &graph,
66
std::vector<bool> &reachable,
7-
int node
7+
int64_t node
88
);

0 commit comments

Comments
 (0)