Backtracking Problems in C/C++
The following is the list of C/C++ programs based on the level of difficulty:
Easy
- Program to Print All Permutations of Given String
- Program to Print All Possible Paths from Top Left to Bottom Right of an MxN Matrix
- Program to Generate All Possible Valid IP Addresses from Given String
- Print All Possible Strings that can be made by Placing Spaces
- Sum of XOR of All Possible Subsets
- Find All Unique Subsets of a Given Set
- Make All Combinations of Size K
- Print All Combinations of Balanced Parentheses
- Combinational Sum
- Print All Possible Words from Phone Digits
Medium
Hard
- Boggle (Find All Possible Words in a Board of Characters) | Set 1
- Permutation of Numbers Such that Sum of Two Consecutive Numbers is a Perfect Square
- Word Ladder (Length of Shortest Chain to Reach a Target Word)
- Printing All Solutions in N-queen Problem
- Algorithm to Solve Sudoku | Sukdoku Solver
- Find Kth Permutation
- Remove Invalid Parentheses
- N Queen Problem
- Partition of A Set into K Subsets with Equal Sum
- Word Break Problem Using Backtracking
C/C++ Backtracking Programs
Backtracking is a problem-solving approach in which every possible solution is tested against the specified constraints. In Backtracking, if a solution fails to meet the given constraints, the algorithm retraces its steps to a previously verified point along the solution path. Backtracking can be viewed as the improvement of the brute-force method as the remaining solutions in the solution path are not considered when an incorrect solution is encountered.
In this article, we will discuss some of the top backtracking practice problems in the C/C++ language.
Prerequisite: Backtracking Algorithms