As with the original graph searching algorithms, a
GraphSolver
can manage the double-ended queue
deque as either:
- A FIFO (first-in first-out) queue, for breadth-first search, or
- A LIFO (last-in first-out) stack, for depth-first search
This is accomplished simply by overriding
the
Solver's
add method: