Question: I need help with this data structures assignment. This is need to be done in the C language. I need help completing this from start
CS 2123 Data Structures Assignment 7 Due Friday April 22 (100 pts) Write a program to read a graph from a file and determine whether the graph is a tree or not. A sample graph is given below Figure 1: Graph representation You can visually see that this graph is not a tree. To determine whether a graph is a tree you can use the following theorem Theorem: Any connected graph with n vertices and n-1 edges is tree. Above graph is connected. However, it has 6 vertices and 7 edges. So, t is not a tree. File format for this assignment is as follows numofvertices numofedges edgel edge2 First line of the file contains the number of vertices and number of edges. Each edge is listed on one line with source vertex and destination vertex. Vertices start at 1. Edges are undirected and will be listed on the file once starting with the smallest vertex id. For example, for edges 2-5 and 5-2 the file will only have 2-5. But, you need to insert both to your adjacency list representation File for above graph is as follows 6 7 1 2 1 5 1 6 2 5 3 4 3 5 Sample execution of the program for the above graph is as follows fox01> assign7 graph1.txt The graph does not belong to a tree
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
