~ Project 3: The Rat Pack

Project 3: Maze

Simulate a rat pack finding food in a maze

Due dates: 10/20/2023 (Part 1); Part 2: 10/27/2023 (Part 2)

Educational Objectives: Understand and experience the implementation of the Stack ADT and its application in the depth first search algorithm. Analyze algorithm complexity.

Statement of Work:

Requirements:

This project contains two parts. In the first part, you will implement a Stack class template as an adaptor class. You have the freedom to use any C++/STL containers except the STL stack container. Note also that, you must not use the Vector class template you have implemented in Project 2: if you need to use the vector class, use the one provided in C++ STL. In the second part of this project, you will implement the depth first search algorithm. More specifically, you will design and implement a simulation that receives as input a rectangular 2-dimensional maze along with start and goal locations (as (row, col) coordinates) in the maze, and that produces a path (when one exists) through the maze from start to goal using depth-first search.

Task 1: Implement Stack as a generic adaptor class template

Stack interface (T is the template parameter, i.e., data type)

Analyzing the worst-case run-time complexity of the member function pop(). Give the complexity in the form of Big-O. Your analysis must be clearly understandable by others. Name the file containing the complexity analysis as "analysis.txt".

Task 2: Design and implement a simulation that simulates a rat pack finding food in a maze.

Downloads:

Click here to download the provided tar file, which contains test_stack.cpp, sample executables test_stack.x, maze.x and maze_extra.x and some pre-made mazes files (maze0, maze1, etc). The sample executables were compiled on a linprog machine.

To run test_stack.x, do './test_stack.x'. To run maze.x, do './maze.x < maze0'.

Deliverables:

For Part 1, turn in all your source program files (Stack.h and Stack.hpp), makefile (to produce executable test_stack.x) and analysis.txt in a tar file via the Canvas system. It is due October 20, 11.59pm.

For part 2, turn in all your source program files (Stack.h, Stack.hpp, and proj3.cpp) and makefile (to produce executable proj3.x) in a tar file via the Canvas system. It is due October 27, 11:59pm.

Grading:

Part 1 (50 points):

Part 2 (50 points):

Hints: