Unit - 5
Unit - 5
1
Q) 1.What is N Queen Problem?
In N-Queen problem, we are given an NxN chessboard and we have to place N number
of queens on the board in such a way that no two queens attack each other. A queen
will attack another queen if it is placed in horizontal, vertical or diagonal points in its
way. The most popular approach for solving the N Queen puzzle is Backtracking.
Input Output Scenario
Suppose the given chessboard is of size 4x4 and we have to arrange exactly 4 queens in
it. The solution arrangement is shown in the figure below −