Follow these steps to create an adjacency list representation of a graph:
- Define a structure called node that contains three members. One member, nme, is for storing the vertex of the graph; another member, vrt, is for connecting vertices of the graph; and, finally, edg is for connecting the adjacent vertices of the vertex.
- The user is asked to specify the count of the vertices in the graph.
- A linked list is created where the nme member of each node contains the vertex of the graph.
- All the nodes representing vertices of the graph are connected to each other using the vrt pointer.
- Once all the vertices are entered, the user is prompted to enter the edges of the graph. The user can enter any number of edges and to indicate ...