| 133 | } |
| 134 | |
| 135 | bool cycleDirectedDFS(int n, vector<int> &vis, vector<int> &dfsvis, vector<int> arr[]) |
| 136 | { |
| 137 | vis[n] = 1; |
| 138 | dfsvis[n] = 1; |
| 139 | |
| 140 | for (auto i : arr[n]) |
| 141 | { |
| 142 | if (vis[i] == 0) |
| 143 | { |
| 144 | if (cycleDirectedDFS(i, vis, dfsvis, arr)) |
| 145 | return true; |
| 146 | } |
| 147 | else |
| 148 | { |
| 149 | if (dfsvis[i]) |
| 150 | return true; |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | dfsvis[n] = 0; |
| 155 | return false; |
| 156 | } |
| 157 | |
| 158 | void findTopoSortDFS(int node, vector<int> arr[], stack<int> &s, vector<int> &vis) |
| 159 | { |
nothing calls this directly
no outgoing calls
no test coverage detected