
Learn core concepts, essential formulas, and attempt practice questions designed on the latest TCS NQT testing patterns.
What is the core strategy of backtracking?
Correct Answer: A) Try all paths and undo invalid steps
Step-by-step Solution: Backtracking explores configuration states recursively. If a path fails to meet criteria, it backtracks and tries the next branch.
Which problem is solved using backtracking?
Correct Answer: A) N-Queens puzzle
Step-by-step Solution: N-Queens requires placing queens on chessboards such that no two attack. It is solved recursively via backtracking.
Always write down base condition checks at the top of recursive helper functions.