Stack-Based Maze Solving (Comments)
Stack space needed in the worst case: Space for n2 positions, assuming the maze array of size n by n.
Time: Each position is visited at most 4 times, once when first arriving, 3 times after backtracking from successor positions.
This search technique is known as Depth-First Search (DFS).
DFS will find a solution if one exists.
DFS will not necessarily find a shortest path.