0% found this document useful (0 votes)
5 views1 page

Backtracking

Backtracking is an algorithmic technique used to navigate paths from a starting point to a goal, applicable in scenarios like mazes, graph traversal, and games. It involves making choices and remembering decision points to retrace steps when a dead-end is encountered. Stacks and recursion are common methods employed to implement backtracking solutions.

Uploaded by

mnlakshmi540
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Backtracking

Backtracking is an algorithmic technique used to navigate paths from a starting point to a goal, applicable in scenarios like mazes, graph traversal, and games. It involves making choices and remembering decision points to retrace steps when a dead-end is encountered. Stacks and recursion are common methods employed to implement backtracking solutions.

Uploaded by

mnlakshmi540
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Backtracking

Backtracking is used in algorithms in which there are steps along some path
(state) from some starting point to some goal.

 Find your way through a maze.

 Find a path from one point in a graph (roadmap) to another point.

 Play a game in which there are moves to be made (checkers, chess).

In all of these cases, there are choices to be made among a number of options.
We need some way to remember these decision points in case we want/need
to come back and try the alternative Consider the maze. At a point where a
choice is made, we may discover that the choice leads to a dead-end. We want
to retrace back to that decision point and then try the other (next) alternative.
Again, stacks can be used as part of the solution. Recursion is another, typically
more favored, solution, which is actually implemented by a stack.

You might also like