In dfs()
, visited
and flag
is kind of weird, using stack to implement dfs is more better in my view.
↧
Answer by rsy56640 for DFS for Graph search with generic data types
↧
In dfs()
, visited
and flag
is kind of weird, using stack to implement dfs is more better in my view.