Recursion Section 5.6

The terminating conditions in findMazePath must be performed in the order specified. What could happen if the second or third condition was evaluated before the first? If the third condition was evaluated before the second condition?

Does it matter in which order the neighbor cells are tested in findMazePath? How could this order affect the path that is found?

Is the path shown in Figure 5.19 the shortest path to the exit? If not, list the cells on the shortest path.


Show the interface GridColors.

Write a Maze.resetTemp method that recolors the cells that are in the TEMPORARY color to the BACKGROUND color.

Write a Maze.restore method that restores the maze to its initial state.