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

Function main

graph/code10.cpp:55–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55int main()
56{
57 int v;
58 v = 6;
59 vector<int> vec[v];
60
61 // adding edges from this point
62
63 // add_edge(vec, 0, 1);
64 // add_edge(vec, 1, 2);
65 // add_edge(vec, 2, 3);
66 // add_edge(vec, 2, 4);
67 // add_edge(vec, 4, 5);
68 // add_edge(vec, 5, 1);
69
70 add_edge(vec, 0, 1);
71 add_edge(vec, 2, 3);
72 add_edge(vec, 3, 4);
73 add_edge(vec, 4, 5);
74 add_edge(vec, 5, 1);
75
76 if (dfs_rec(vec, v))
77 {
78 cout << "There is a cycle in the graph!!" << endl;
79 }
80 else
81 {
82 cout << "There isnt a cycle in the graph!!" << endl;
83 }
84 return 0;
85}

Callers

nothing calls this directly

Calls 2

add_edgeFunction · 0.70
dfs_recFunction · 0.70

Tested by

no test coverage detected