N-Queens

Back to Backtracking

Place N queens on an N x N chessboard so that no two queens threaten each other. A classic backtracking problem that systematically places queens column by column, backtracking when a conflict is detected. Demonstrates constraint propagation and pruning.

algorithms backtracking n-queens