Introduction To Backtracking
Introduction To Backtracking
Introduction to Backtracking
Backtracking
Backtracking is a technique used to solve
problems with a large search space, by
systematically trying and eliminating possibilities.
Portion A
Portion B
Backtracking
One strategy would be
to try going through
Portion A of the maze.
Portion B
If you get stuck before
you find your way out,
Portion A
then you "backtrack"
to the junction.
if (location == SIZE) {
Found a solution to the problem, so print it!
printSol(perm);
}
for (int i=0; i<SIZE; i++) { Loop through possible rows to place this queen.