Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this second problem we will practice on Stacks. You have to implement a maze. In this you have given a text file in

In this second problem we will practice on Stacks. You have to implement a maze. In this you have given a text file in which attributes for implementing maze are given that are: 4 3 4 You have to read this information from the input file. NOTE: Your code should implement the maze if the attributes are changed in the text file, code adjust to it. (Code should be generic). For Example: 0 1) No. of Rows and No. of Columns (2D LinkList) separated with space. 2) Starting point will always be (0, 0). 3) Exit point will be specified in the file. 4) 2 1 3 4 3 No. of Hurdles in that particular maze. Indices on which you have to mark hurdles, Rows and Columns separated with space. 3 0 2 2 No. of Rows and No. of Columns (2D LinkList) separated with space as shown in figure 01 row and col of Maze End No. of Hurdles row=0 and col=3 of hurdle A maze of 4 rows and 4 columns. 4 hurdles, indices containing hurdles are (0,3), (2,0),(1,2),(3,2). Starting point is (0, 0) and exit point in this case is (3, 3). 1. '1' shows the hurdles; you can use any character for hurdles; 2. 'S' shows the starting point 3. 'E' shows the exit point. S 1 1 1 1 E Figure 1 Once the maze is created you have to find the path from starting point to the exit point using STACKS. Marks distribution: 1. 10 marks for Maze creations (read form file and create 2D linklist) 2. Path finding using stack (30 Marks). 3. Your program must detect their no path exists (10 Marks). You should compute a path that leads you from the entrance (row 0, column 0) to the exit. If no such path exists, your program should be able to tell the user that maze has no exit.

Step by Step Solution

3.47 Rating (147 Votes )

There are 3 Steps involved in it

Step: 1

To implement this maze you can start by reading the values from the input file and storing them in v... blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

College Mathematics for Business Economics Life Sciences and Social Sciences

Authors: Raymond A. Barnett, Michael R. Ziegler, Karl E. Byleen

12th edition

321614003, 978-0321614001

More Books

Students also viewed these Programming questions

Question

Repeat Problem 23 with Problem 6 and 8 Problem 23

Answered: 1 week ago