Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Graph.h"
- using namespace std;
- int main()
- {
- // create the graph given in above fugure
- int V = 5;
- Graph* graph = new Graph(V);
- graph->addEdge(0,1);
- graph->addEdge(0, 4);
- graph->addEdge(1, 2);
- graph->addEdge(1, 3);
- graph->addEdge(1, 4);
- graph->addEdge(2, 3);
- graph->addEdge(3, 4);
- // print the adjacency list representation of the above graph
- graph->print();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement