IPKN  00.001.b
Inter Pocket Knowledge Network
main.cpp
Go to the documentation of this file.
1 /*
2 this is just a graph ds later improvements are to be incorporated
3 
4 */
5 
6 
7 
8 #include "shared/Graph.cc"
9 int main(int argc, char *argv[])
10 {
11 
12 
13  // go create the graph
14  GGraph::Graph g(4);
15  g.addEdge(0, 1);
16  g.addEdge(0, 2);
17  g.addEdge(1, 2);
18  g.addEdge(2, 0);
19  g.addEdge(2, 3);
20  g.addEdge(3, 3);
21 
22  std::cout << "Following is Breadth First Traversal "
23  << "(starting from vertex 2) :: ";
24  g.BFS(2);
25 
26  //for dfs
27  std::cout << "Following is Depth First Traversal (starting from vertex 2) :: ";
28  g.DFS(2);
29  return 0;
30 }
int main(int argc, char *argv[])
Definition: main.cpp:9