MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / findTopoSortDFS

Function findTopoSortDFS

CPP/graphseries.cpp:158–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void findTopoSortDFS(int node, vector<int> arr[], stack<int> &s, vector<int> &vis)
159{
160 vis[node] = 1;
161
162 for (auto i : arr[node])
163 {
164 if (!vis[i])
165 {
166 findTopoSortDFS(i, arr, s, vis);
167 }
168 }
169
170 s.push(node);
171}
172
173vector<int> topoSortDFS(vector<int> arr[], int n)
174{

Callers 1

topoSortDFSFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected