stacks define maze adt maze is two-dimensional structure divided into rows and columns of equal-sized cells the individual cells can be filled representing wall or empty representing an open space one cell is marked as the starting position and another as the exit mazenumrowsnumcols )creates new maze with all of the cells initialized as open cells the starting and exit positions are undefined numrows()returns the number of rows in the maze numcols()returns the number of columns in the maze setwallrowcol )fills the indicated cell (rowcolwith wall the cell indices must be within the valid range of rows and columns setstartrowcol )sets the indicated cell (rowcolas the starting position the cell indices must be within the valid range setexitrowcol )sets the indicated cell (rowcolas the exit position the cell indices must be within the valid range findpath()attempts to the solve the maze by finding path from the starting position to the exit if solution is foundthe path is marked with tokens (xand true is returned for maze with no solutionfalse is returned and the maze is left in its original state the maze must contain both the starting and exit position cells on the perimeter of the maze can be open and it can be assumed there is an invisible wall surrounding the entire maze reset()resets the maze to its original state by removing any tokens placed during the find path operation draw()prints the maze in readable format using characters to represent the walls and path through the mazeif path has been found both the starting and exit positions are also indicatedif previously set our adt definition is not meant for general purpose mazebut instead one that can be used to build maze and then solve and print the result more general purpose adt would most likely return the solution path as list of tuples instead of simply marking the cells within the maze as is the case in our definition example use we can use this definition of the adt to construct program for building and solving maze as shown in listing the main routine is rather simple since we need only build the mazedetermine if path exists and print the maze if path does exist