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

Function main

CPP/BFS_AND_DFS.cpp:73–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73int main()
74{
75 cout<<"Enter the no. of vertices : ";
76 cin>>v;
77 vector<int> adj[v];
78 vector<bool> visit(v,false);
79 Add_edge(adj,0,1);
80 Add_edge(adj,0,2);
81 Add_edge(adj,1,2);
82 Add_edge(adj,2,0);
83 Add_edge(adj,2,3);
84 Add_edge(adj,3,3);
85
86 int temp;
87 cout<<"Choose the vertex from you want to start traversing : ";
88 cin>>temp;
89 cout<<"\nBFS traversal is"<<" ";
90 bfs(temp,adj);
91 cout<<"\nDFS traversal is"<<" ";
92 dfs(temp,adj);
93
94 return 0;
95}

Callers

nothing calls this directly

Calls 3

Add_edgeFunction · 0.85
bfsFunction · 0.70
dfsFunction · 0.70

Tested by

no test coverage detected