Lab 4 – Stacks and Queues: Simply A-Maze-ing!

Due 10:00pm, Sunday, March 5th 2023

In this lab you will use the power of a stack and a queue to explore and find your way through a maze. After this lab you should be able to:

  • implement stacks and queues;
  • use your stack and queue to solve a maze; and
  • explore the differences between the two solution strategies.

This lab is a little larger than past labs; it has many different pieces that all need to work together. Most pieces are small, but it may take some additional patience on your part. Just chug along and the end will show itself in due time!

You may work with a partner on this assignment—both during and after the lab session.

We provide you with the following Java files that you do not need to change:

  • Square.java
  • Maze.java
  • MazeApp.java
  • StackADT.java
  • QueueADT.java

You will need to modify the following file:

  • MazeSolver.java

You will need to create the following files:

  • MyStack.java
  • MyQueue.java
  • MyStackTest.java
  • MyQueueTest.java
  • MazeSolverStack.java
  • MazeSolverQueue.java

I’ve supplied starting code, including some sample mazes here.

Next »