Linked List and Stack Application – Depth First Search
implement a depth first search that helps a user to find his way home from a given location. He is currently in Gdansk and his home is in Warsaw. To accomplish this task, you will be given a map of possible train connections below. You will be required to create a program that finds the list of cities that the agent must travel on in order to get home
Gdansk
Koszalin
Elblag
Glycko
Poznan
Bydgocscs
Olszlyn
Warsaw
Lodz
Radom
Your program must take in an arbitrarily large list of connection and find a possible route to take. It will then output a list of each city taken in order (see example file). An example input (described in a text file) is follows:
Gdansk Koszalin
Gdansk Elblag
Gdansk Glyko
Koszalin Poznan
Koszalin Bydgocscs
Elblag Olczlyn
Glyko Warsaw
Poznan Lodz
Bydgocscs Radom
Your program also takes the starting point (which is Gdansk) and goal (Warsaw) as inputs.
Your program would return the output of cities from Gdansk to Warsaw using Depth First Search.
Is this the question you were looking for? If so, place your order here to get started!