Data Structures, Algorithms, & Applications in C++
Chapter 9, Exercise 33

If our objective is to determine whether or not there is a path from the maze entrance to the maze exit, we can use either a stack or a queue. However, to reconstruct the path to the maze exit, it is necessary to use a stack. To enable path reconstruction using a queue, we must use code similar to the wire routing code.