Question: PLease don't forget to put the user input User interface: C++ code. 1[25 Points] Adjacency List Given the Adjacency List of an undirected graph, write
PLease don't forget to put the user input
User interface:
![1[25 Points] Adjacency List Given the Adjacency List of an undirected graph,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f45e41cd845_94566f45e413aff8.jpg)
C++ code.
1[25 Points] Adjacency List Given the Adjacency List of an undirected graph, write a C++ program to determine the following. a) If the graph has self-loops b) If the graph is completely connected c) If the graph has an isolated vertex Print suitable messages. Ex. The graph has no self-loops; The graph has self-loops at vertices A, D'; The graph is not completely connected; The graph has no isolated vertex; The vertex C' in the graph is isolated; etc. The program should be designed in a way which facilitates testing by a user via specifying the number of (vertices) nodes, and the vertices adjacent to any given vertex. The following is a suggested outline. You have the flexibility to improve upon it, as long as it provides the interaction by a user to create the graph and ask questions. In the following it is assumed that the vertices are automatically labeled A, B, C, etc. B For example, the interaction when the program is run is as follows (user input is shown in 'red'). Type in the number of vertices in the graph: 5 Type in the vertices adjacent to 'A': BCE Type in the vertices adjacent to B: A, E, D Type in the vertices adjacent to 'C': AC (... etc....) After the graph (ex. above) is created, it should print out the answers to the questions in the exercise. Vertices with self-loops: C Graph is not completely connected The graph has no isolated vertex For the (ex. below), it should print out: B Vertices with the maximum in-degree: E (in-degree = 3) Vertices with the minimum in-degree: D (in-degree = 0) Vertices with the maximum out-degree: A (out-degree = 3) Vertices with the minimum out-degree: E (out-degree = 0) ... Etc
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
