Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve with java by using grahp data structure. Thank you for your effort. James Bond has a top-secret mission. He must enter a maze and

Solve with java by using grahp data structure. Thank you for your effort. image text in transcribed

image text in transcribed

image text in transcribed

James Bond has a top-secret mission. He must enter a maze and find some treasures. In this homework, you should help him, and you are expected to create a maze solver algorithm. Lucky for you, you have a map of the mazes. These maps contain 3 groups of characters as shown in the example maze in the next page: - Walls are represented with "+", "-", and "|" characters. When you see one of these characters, you cannot go any further. - Available paths are represented with lower case characters such as "a", "b", "c" and etc. When you see one of these characters, you can move forward. - Treasures are represented with capital " E " characters. When you see this character, this means that you can find a path successfully. For the above maze, there are 3 " E " characters, and all are reachable. Therefore, you should print all paths according to increasing order of paths lengths. You should read the maze file name from console. Here is the sample argument: The output for the above maze is as follows. Please check your program with this input as well as the others that you will create. Note that we will use other input when grading your assignments. Also, note that maze can contain a path that has a loop as shown in the following maze with a red box. For this case, your algorithm shouldn't get stuck in the loop. Therefore, you should avoid visiting already visited path

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions