Why do I need to assign false to each element in BFS but not in DFS

后端 未结 0 2001
独厮守ぢ
独厮守ぢ 2020-12-03 17:55

Function definitions are :

// DFS algorithm
void Graph::DFS(int current) {


    visited[current] = true;
    cout<

        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题