+ 2
Rectify the error in the output optained in the following nqueen problem code .
2 Réponses
0
If you wish, I'll work with you to solve this by commenting on your code.
- 1
Your 50 array size only supports a 7x7 board. The first meaningful board is 3x3 as only one queen can be on a 1x1 or 2x2. Therefore, you should only allow 3 to 7 for n or modify the array like x[9][9] (supports 9x9). The two dimensional array makes for more understandable code.