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?
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
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?
Explanation: N-queens problem occurs in chess. It is the problem of placing n- queens in a n*n chess board.
4. Not more than 2 queens can occur in an n-queens problem.
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?
Explanation: N-queen problem does not provide an optimal solution of only three values of n (i.e.) n=2,3.
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
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?
Explanation: Of the following given options for optimal solutions of 4-queens problem, (3, 1, 4, 2) is the right option.
8. How many possible solutions exist for an 8-queen problem?
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?
Explanation: For a 10-queen problem, 724 possible combinations of optimal solutions are available.
10. If n=1, an imaginary solution for the problem exists.
Explanation: For n=1, the n-queen problem has a trivial and real solution and it is represented by
11. What is the domination number for 8-queen’s problem?
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?
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.