Q:

(Display a DFS/BFS tree in a graph) Modify GraphView in Listing 28.6 to add a new data field tree with a set method

0

 (Display a DFS/BFS tree in a graph) Modify GraphView in Listing 28.6 to add a new data field tree with a set method. The edges in the tree are displayed in red. Write a program that displays the graph in Figure 28.1 and the DFS/BFS tree starting from a specified city, as shown in Figures 28.13 and 28.16. If a city not in the map is entered, the program displays an error message in the label.

FIGURE 28.1 A graph can be used to model the flights between the cities.

FIGURE 28.13 A DFS search starts from Chicago.

FIGURE 28.16 BFS search starts from Chicago.

All Answers

total answers (0)

Similar questions


need a help?


find thousands of online teachers now