Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool dfs(int u, int col)
- {
- color[v] = 1;
- bool flag = false;
- for (int i = 0; i < s[v].size(); i++){
- int u = s[v][i];
- if (color[u] == 0)
- dfs(u);
- if (color[u] == 1)
- flag = true;
- }
- color[v] = 2;
- return flag;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement