how to mark intially all node unvisited,there is error showing in line no. 26 how to remove it??
Dfs traversal error
@Ashu1318 hey error is coming because of auto iterator, use iterator of map, also there is no need to set values of map as 0, as just use make map[node]=1 to make visited and to check condition of unvisit check whether map[node]!=1 or you ay take visited array in place of map,it will be more easier.