Question

In a backtracking algorithm, what happens when a partial solution is found to violate a constraint?

A The algorithm immediately terminates.
B The algorithm switches to a greedy approach.
C The algorithm "backtracks" to a previous decision point and tries a different choice.
D The algorithm stores the invalid path and continues exploring.
E The algorithm re-evaluates all previous decisions.
Practice Next

Hey! Ask a query