Question: In this lab, you will implement a stack and queue, and. using these data structures, you will generate a random maze and then solve the

In this lab, you will implement a stack and queue, and. using these data structures, you will generate a random maze and then solve the maze. The methodology behind this process is that a stack mimics depth-first-search mechanisms while a queue mimics breadth-first-search mechanisms. In the context of a maze, you can consider depth-first-search as traversing a path through the maze until you reach a dead-end (or the exit), and then backing up until you have a new path choice, and traversing that until you reach a dead-end (or the exit), and then backing up and etc. While breadth-first-search traversal of a maze will step through all path at the same time until they reach the maze exit. Below is a sample maze solution using depth-first-search, where indicates a cell on the path and * indicates a cell visited but not on the path. Note that the routine blacked-out of the dead-end twice in the upper right-hand quadrant before eventually following the correct downward path towards the exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
