| 112 | } |
| 113 | |
| 114 | bool bipertiteDFS(int n, vector<int> &color, vector<int> arr[]) |
| 115 | { |
| 116 | if (color[n] == -1) |
| 117 | color[n] = 1; |
| 118 | for (auto i : arr[n]) |
| 119 | { |
| 120 | if (color[i] == -1) |
| 121 | { |
| 122 | color[i] = 1 - color[n]; |
| 123 | if (!bipertiteDFS(i, color, arr)) |
| 124 | return false; |
| 125 | } |
| 126 | else |
| 127 | { |
| 128 | if (color[i] == color[n]) |
| 129 | return false; |
| 130 | } |
| 131 | } |
| 132 | return true; |
| 133 | } |
| 134 | |
| 135 | bool cycleDirectedDFS(int n, vector<int> &vis, vector<int> &dfsvis, vector<int> arr[]) |
| 136 | { |
nothing calls this directly
no outgoing calls
no test coverage detected