8 queen problem

2.8

The eight queens problem is the problem of placing eight queens on an 8×8 chessboard such that none of them attack one another (no two are in the same row, column, or diagonal). More generally, the n queens problem places n queens on an n×n chessboard.

There are different solutions for the problem.

Backtracking | Set 3 (N Queen Problem)

Branch and Bound | Set 5 (N Queen Problem)

You can find detailed solutions at http://en.literateprograms.org/Eight_queens_puzzle_(C)

GATE CS Corner    Company Wise Coding Practice

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.

Recommended Posts:



2.8 Average Difficulty : 2.8/5.0
Based on 9 vote(s)










Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.