N Queens Problem Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “N Queens Problem”.

1. In how many directions do queens attack each other?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: c
Explanation: Queens attack each other in three directions- vertical, horizontal and diagonal.

2. Placing n-queens so that no two queens attack each other is called?
a) n-queen’s problem
b) 8-queen’s problem
c) Hamiltonian circuit problem
d) subset sum problem
View Answer

Answer: a
Explanation: Placing n queens so that no two queens attack each other is n-queens problem. If n=8, it is called as 8-queens problem.

3. Where is the n-queens problem implemented?
a) carom
b) chess
c) ludo
d) cards
View Answer

Answer: b
Explanation: N-queens problem occurs in chess. It is the problem of placing n- queens in a n*n chess board.
advertisement
advertisement

4. Not more than 2 queens can occur in an n-queens problem.
a) true
b) false
View Answer

Answer: b
Explanation: Unlike a real chess game, n-queens occur in a n-queen problem since it is the problem of dealing with n-queens.

5. In n-queen problem, how many values of n does not provide an optimal solution?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation: N-queen problem does not provide an optimal solution of only three values of n (i.e.) n=2,3.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which of the following methods can be used to solve n-queen’s problem?
a) greedy algorithm
b) divide and conquer
c) iterative improvement
d) backtracking
View Answer

Answer: d
Explanation: Of the following given approaches, n-queens problem can be solved using backtracking. It can also be solved using branch and bound.

7. Of the following given options, which one of the following is a correct option that provides an optimal solution for 4-queens problem?
a) (3,1,4,2)
b) (2,3,1,4)
c) (4,3,2,1)
d) (4,2,3,1)
View Answer

Answer: a
Explanation: Of the following given options for optimal solutions of 4-queens problem, (3, 1, 4, 2) is the right option.
advertisement

8. How many possible solutions exist for an 8-queen problem?
a) 100
b) 98
c) 92
d) 88
View Answer

Answer: c
Explanation: For an 8-queen problem, there are 92 possible combinations of optimal solutions.

9. How many possible solutions occur for a 10-queen problem?
a) 850
b) 742
c) 842
d) 724
View Answer

Answer: d
Explanation: For a 10-queen problem, 724 possible combinations of optimal solutions are available.
advertisement

10. If n=1, an imaginary solution for the problem exists.
a) true
b) false
View Answer

Answer: b
Explanation: For n=1, the n-queen problem has a trivial and real solution and it is represented byThe n-queen problem has a trivial & real solution & it is represented in diagram

11. What is the domination number for 8-queen’s problem?
a) 8
b) 7
c) 6
d) 5
View Answer

Answer: d
Explanation: The minimum number of queens needed to occupy every square in n-queens problem is called domination number. While n=8, the domination number is 5.

12. Of the following given options, which one of the following does not provides an optimal solution for 8-queens problem?
a) (5,3,8,4,7,1,6,2)
b) (1,6,3,8,3,2,4,7)
c) (4,1,5,8,6,3,7,2)
d) (6,2,7,1,4,8,5,3)
View Answer

Answer: b
Explanation: The following given options for optimal solutions of 8-queens problem, (1,6,3,8,3,2,4,7) does not provide an optimal solution.

Sanfoundry Global Education & Learning Series – Data Structures & Algorithms.

To practice all areas of Data Structures & Algorithms, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.