Data Structures and Algorithms

You are to write a program to read a text file containing information about an undirected,
unweighted graph, create an adjacency matrix representation, and traverse the graph using
eitherbreadth-firstordepth-firstsearchmethods.
Followthesesteps:
1.Readatextfilethatcontainsthenumberofverticesonthefirstlinefollowedbytheedges.You
may assume that the vertices are represented by Strings A, B, C, etc. For instance, for the

followinggraph?

theinputtextfilewillbe(orderoftheedgesdoesn’tmatter):
5
E A
E B
A B

Leave a Reply

Your email address will not be published. Required fields are marked *