In this second problem we will practice on Stacks. You have to implement a maze. In...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
To implement this maze you can start by reading the values from the input file and storing them in v... View the full answer
Related Book For
College Mathematics for Business Economics Life Sciences and Social Sciences
ISBN: 978-0321614001
12th edition
Authors: Raymond A. Barnett, Michael R. Ziegler, Karl E. Byleen
Posted Date:
Students also viewed these programming questions
-
You have to implement encryption and decryption with Simplied DES, as discussed in the class and in Stallings 3rd edition. The permutations IP, P10, P8, and SW, and the functions fk; F, and the S-box...
-
Suppose you have to implement an algorithm to remove from the ring buffer all items whose timestamps are within a range [t1, t2), that is remove all items x for which t1 x.time < t2. Explain why...
-
A 2D Array consists of four rows and six columns. Each row represents a student while each column represents a lab grade. Write the following functions and test them: ¢ Print the average grade...
-
At Acme Corp., the firm's senior managers approach marketing implementation with the belief that marketing strategy should be developed at the top of the organization and then transmitted to lower...
-
What is meant by Six Sigma? What five steps are usually associated with Six Sigma applications?
-
Solve each quadratic inequality. Graph each solution. 10r 2 + r 2
-
Electron 1 , initially traveling to the right at \(1.5 \times 10^{6} \mathrm{~m} / \mathrm{s}\), is accelerated upward at \(900 \mathrm{~m} / \mathrm{s}^{2}\) by the electromagnetic force exerted by...
-
Mercedes is assessing which of two windshield suppli-ers provides a better environmental design for disassembly. Using the tables below, select between PG Glass and Glass Unlimited. PG GLASS...
-
14.An equi-concave lens of radius of curvature 15 cm and = 1.5 is placed in water (=1.33). If one surface is silvered, then image distance from lens when an object is placed at distance of 14 cm from...
-
Casey Morgan is a single taxpayer, social security number 412-34-5670, who lives at 582 Brockton Lane, Columbus, OH 43081. Casey has income from a job as a manager, interest and dividend income, and...
-
Write short notes on: 1. Tolerance limits 2. Significant and non-significant variances 3. Graphic and tabular presentation of variances 4. Disposal of variances.
-
What reasons would there be for a parent to litigate under Section 504 or the ADA instead of complaining to the Department of Education?
-
By issuing US$500 million of BBBrated future exports-backed securities through an offshore special purpose vehicle (SPV), Pemex was able to lower its cost of debt by 337. 5 basis points as compared...
-
Honda shares trade on the Tokyo Stock Exchange and on the NYSE as an ADR. a. Assuming that Honda stock closed at 2,177 and that 76.55 = US$1, at what price would you expect Honda to trade on the...
-
Consider the following scenario: Jeff is a second grade student with a learning disability in reading. His individualized education program (IEP) includes direct individualized instruction in basic...
-
Bond M is a 4 % coupon bond and Bond N is a 12% coupon bond. Both bonds have twelve years to maturity and issued 2 years ago, make annual payment and have YTM of 8%. i. Calculate the bond value for...
-
A consultant is beginning work on three projects. The expected profits from these projects are $50,000, $72,000, and $40,000. The associated standard deviations are $10,000, $12,000, and $9,000....
-
Subtract the sum of the first two polynomials from the sum of the last two: 3m2 - 2m + 5, 4m2 - m, 3m2 - 3m - 2, m3 + m2 + 2
-
Repeat Problem 23 with Problem 6 and 8 Problem 23
-
Find the total income produced by a continuous income stream in the first 2 years if the rate of flow is f(t)= 600e0.06t.
-
A single stage single acting air compressor has intake pressure 1 bar and delivery pressure 10 bar. The compression and expansion follow the law \(\mathrm{pV}^{1.3}=\) constant. The piston speed and...
-
Airplane employs the following type of compressor: (a) Reciprocating compressor (b) Centrifugal compressor (c) Axial flow compressor (d) None of these
-
Find the expression for volumetric efficiency of the reciprocating compressor.
Study smarter with the SolutionInn App