Backtracking
Explore all possibilities and undo bad choices. 2 programs in C with full explanations for VTU BCSL40A.
Backtracking
T: O(2ⁿ)
S: O(n)
Subset Sum Problem
The Subset Sum problem uses backtracking to find all subsets of a given set whose elements sum to a target value.
View Algorithm
Backtracking
T: O(N!)
S: O(N)
N-Queens Problem
The N-Queens problem uses backtracking to place N queens on an N×N chessboard so that no two queens attack each other.
View Algorithm