The algorithm uses it's own stack (not the system stack) to keep track of the locations along the path it creates. This allows it to backtrack when a dead end is reached, by popping the previous ...
Mark it as visited Check if it is the goal If not, visit “next” unvisited neighbor If no unvisited neighbors, return to “parent” cell This program together with a maze generation program can be used ...