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

Function topo_rec

graph/code12.cpp:31–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void topo_rec(vector<int> vec[], int v)
32{
33 vector<bool> visited(v, false);
34 stack<int> s;
35 for (int i = 0; i < v; i++)
36 {
37 if (visited[i] == false)
38 {
39 topo_sort(vec, visited, i, s);
40 }
41 }
42
43 while(s.size() > 0) {
44 int curr = s.top();
45 s.pop();
46 cout<<curr << " ";
47 }
48 return;
49}
50
51int main()
52{

Callers 1

mainFunction · 0.85

Calls 4

topMethod · 0.80
topo_sortFunction · 0.70
sizeMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected