Question: You are required to implement graph through adjacency list. User should read data from files having node(node.txt) and edge information(edges.txt). On the basis of information
- You are required to implement graph through adjacency list. User should read data from files having node(node.txt) and edge information(edges.txt). On the basis of information from files, graph should be implemented. User should be given following options:
- Add new node.
- Add new edge
- Delete existing node
- Delete existing edge
- Find total number of edges
- Search a path between two nodes
- Depth first traversal.
- Breath first traversal.
file 1( edge.txt)
a,b a,e a,h b,d b,a b,f d,c c,e c,a c,d c,g c,h f,g f,h g,h g,a g,d
file 2 (nodes.txt)
a b d c f g h
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
