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

Function main

graph/code7.cpp:60–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int main()
61{
62 int v;
63 v = 6;
64 vector<int> adj[v];
65
66 // adding edges now
67 add_edge(adj, 0, 1);
68 add_edge(adj, 0, 2);
69 add_edge(adj, 0, 3);
70 add_edge(adj, 1, 4);
71 add_edge(adj, 1, 5);
72 add_edge(adj, 2, 5);
73
74 // find if it has a loop or not
75 if (bfs_rec(adj, v))
76 {
77 cout << "It has a loop !!" << endl;
78 }
79 else
80 {
81 cout << "It doesnt have a loop!!" << endl;
82 }
83 return 0;
84}

Callers

nothing calls this directly

Calls 2

bfs_recFunction · 0.85
add_edgeFunction · 0.70

Tested by

no test coverage detected