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
Counting the number of components is simple dfs implementation. A simple knowledge of DFS is enough for this problem. We just need to run dfs starting from any node. In one dfs all the nodes of the same component will be visited. Thus this is one component. The count of dfs run is simply the number of components in the graph The sample above is FIRESC taken from CODECHEF. URL: https://www.codechef.com/problems/FIRESC
0 commit comments