Backtracking Algorithm as the name suggests is an algorithm which backtracks for solutions and works for problems with constraints satisfaction.Recursion is the key method to Backtracking algorithms. Here we use recursion in an incremental way to tackle the problem.For example, N Queens problem or Knight's tour problem. Say at any point in the stack, the function fails to tackle the problem and returns false, the predecessor function is invoked (i.e. backtracked) and the necessary functional block takes care of the problem.
I have attempted few problems from Geeks4Geeks for an indepth understanding of Backtracking algorithms.
[Refer to this]
- Knight's Tour problem [1]
- Printing all permutations of a string.