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

Function main

graph/code9.cpp:55–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55int main()
56{
57 int v;
58 v = 5;
59 vector<int> vec[v];
60
61 // adding edges from this point
62 add_edge(vec, 0, 1);
63 add_edge(vec, 0, 3);
64 add_edge(vec, 1, 2);
65 add_edge(vec, 2, 4);
66 add_edge(vec, 3, 1);
67 add_edge(vec, 4, 3);
68
69 if (topo_sort(vec, v))
70 {
71 cout << "No cycle " << endl;
72 }
73 else
74 {
75 cout << "there is a cycle" << endl;
76 }
77
78 return 0;
79}

Callers

nothing calls this directly

Calls 2

add_edgeFunction · 0.70
topo_sortFunction · 0.70

Tested by

no test coverage detected