Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include "Graph.h"
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. // create the graph given in above fugure
  8. int V = 5;
  9. Graph* graph = new Graph(V);
  10. graph->addEdge(0,1);
  11. graph->addEdge(0, 4);
  12. graph->addEdge(1, 2);
  13. graph->addEdge(1, 3);
  14. graph->addEdge(1, 4);
  15. graph->addEdge(2, 3);
  16. graph->addEdge(3, 4);
  17.  
  18. // print the adjacency list representation of the above graph
  19. graph->print();
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement