0
19kviews
Explain 8 Queen Problems.
1 Answer
| written 9.4 years ago by |
8 Queen Problem Chessboard
| Q | |||||||
|---|---|---|---|---|---|---|---|
| Q | |||||||
| Q | |||||||
| Q | |||||||
| Q | |||||||
| Q | |||||||
| Q | |||||||
| Q |
Let solve the 8-queen problem via a backtracking solution.
Let the chessboard squares is numbered as the indices of the two dimensional array a [1:n, 1:n], then every element on the same diagonal that runs from the upper …