(classic problem)
Definition: Place n chess queens on an n × n board such that no queen can attack another. Efficiently find all possible placements.
See also 8 queens.
Note: A backtracking algorithm may be efficient enough for small values of n.
Author: PEB
If you have suggestions, corrections, or comments, please get in touch with Paul Black.
Entry modified 29 April 2010.
HTML page formatted Mon May 11 15:07:57 2026.
Cite this as:
Paul E. Black, "n queens", in
Dictionary of Algorithms and Data Structures [online], Vreda Pieterse and Paul E. Black, eds. 29 April 2010. (accessed TODAY)
Available from: /HTML/nqueens.html