You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It goes into dfs, passes the first branch 1->2->3, marks these nodes as used, then goes through the second branch and when it gets to the node 3 again it incorrectly assumes there is a cycle. But there is no cycle, the graph is directed.
The text was updated successfully, but these errors were encountered:
It seems the code given at https://ru.algorithmica.org/cs/graph-traversals/cycle/ incorrectly finds a cycle in the following directed graph:
1->2->3
1->4->3
It goes into
dfs
, passes the first branch 1->2->3, marks these nodes as used, then goes through the second branch and when it gets to the node 3 again it incorrectly assumes there is a cycle. But there is no cycle, the graph is directed.The text was updated successfully, but these errors were encountered: