Unlock access to all the studying documents.
View Full Document
Student Name: __________________
Class and Section __________________
Total Points (20 pts) __________________
Due: Nov 26, 2018 before the class
Project: Test If a Graph is Connected
CSCI 3230 Data Structures
Georgia Southern University
Problem Description:
*28.1 (Test whether a graph is connected) Write a program that reads a graph from a file and
determines whether the graph is connected. The first line in the file contains a number that
Figure 28.21
The vertices and edges of a graph can be stored in a file.
File
6
0 1 2
1 0 3
2 0 3 4
3 1 2 4 5
4 2 3 5
5 3 4
File
6
0 1 2 3
1 0 3
2 0 3
3 0 1 2
4 5
5 4
(a) (b)
Your program should prompt the user to enter a URL for the file, then it should read data from
<output>
Enter a URL: https://liveexample.pearsoncmg.com/test/GraphSample1.txt <enter icon>
The number of vertices is 6
Vertex 0: (0, 1) (0, 2)
<output>
Enter a URL: https://liveexample.pearsoncmg.com/test/GraphSample2.txt <enter icon>
The number of vertices is 6
0 (0): (0, 1) (0, 2) (0, 3)
Paste your code here: You need to paste your main class only.
What to submit?
1. Compile and Submit to LiveLab (you must submit the program regardless whether it
complete or incomplete, correct or incorrect)
2. Email this document.