Develop a Java program to traverse a graph using the breadth first strategy. You will need to use a queue to keep track
Posted: Wed Apr 27, 2022 4:59 pm
Develop a Java program to traverse a graph using the breadth first strategy. You will need to use a queue to keep track of nodes visited. Your algorithm should visit every node in the graph. Make sure to mark nodes as visited so that they are not processed more than once. Use an adjacency list to represent the graph. Test your program on the graph shown below, starting with node A. The output of your program should be a string of characters (A, B, etc.) in the correct sequence of nodes traversed. D с