77 318
Assignments Done
99,2%
Successfully Done
In July 2019

# Answer to Question #17503 in Quantitative Methods for Sujata Roy

Question #17503
Describe 4 queen's problem.
The idea is that we have a 4&times;4 chess table, and 4 Queen chess pieces. We now have to position those 4 Queens in such a way that there is only one queen per line and none of them are able to capture any other using standard chess moves.

To detect a collision between Queens, we need to check the columns and the diagonals. Collisions can be easily checked if we assign index positions to chess board matrix and keep 3 separate collision lists: one for columns and two for the diagonals. We update the collision lists whenever a Queen is placed. For the column list, we simply add the Queen&rsquo;s column position; for one diagonal, we add the sum of the Queen&rsquo;s line with the Queen&rsquo;s column to the list; and for the other diagonal, we add the subtraction of the line and column position to the list.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!