Skip to content

Commit

Permalink
Fix DFS algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
vadyushkins committed Dec 18, 2023
1 parent c05f08d commit 1b07f21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions algorithms/dfs/dfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
std::vector<bool> &dfs(
const std::vector<std::vector<int64_t>> &graph,
std::vector<bool> &reachable,
int node
int64_t node
) {
reachable[node] = true;
for (int neighbour : graph[node]) {
for (int64_t neighbour : graph[node]) {
if (false == reachable[neighbour]) {
dfs(graph, reachable, neighbour);
}
Expand Down
2 changes: 1 addition & 1 deletion algorithms/dfs/dfs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
std::vector<bool> &dfs(
const std::vector<std::vector<int64_t>> &graph,
std::vector<bool> &reachable,
int node
int64_t node
);

0 comments on commit 1b07f21

Please sign in to comment.