Redo the maze search project in Chapter 4 without using recursion in the tryToSolve method. In other words, use an iterative method that uses a deque to simulate recursion. The original version of the project is accessible from the Source Code link on the book's website. You do not have to use the code from chapter 4, you can write your own code.
The input for this program will be a file, maze.txt, that contains the following info:
1st line: two fields, number of rows and number of columns, relative to 1, in the maze.
2nd line: starting position for the path (row, column, relative to 0).
3rd line: ending position for the path (row, column, relative to 0).
The remaining lines of the file are the values for the corridors and walls of the maze in a row by row format. (1 represents a corridor, 0 represents a wall).
This file can be found in the Maze Program Files folder.
The maze must be stored in a two dimension vector. A deque must be used to simulate the recursion. Do not use any arrays in your program. Your program should print out a message each time it tries a new path and print out a message each time it backtracks. At the end, the program should print out the complete path found. Sample output can be found in the Maze Program Files folder. You may want to write your output to a text file as the output will scroll off the cout window.
The code from the text uses classes, but you are not required to use classes in your program implementation. Once again, if you have more than one file to submit, they must be zipped together, if you have only one .cpp file, it can be submitted by itself.
Note: Make sure your program indicates when a maze is unsolvable.