Data Structures & Algorithms Multiple Choice Questions on “P, NP, NP-hard, NP-complete Complexity Classes”.
1. The worst-case efficiency of solving a problem in polynomial time is?
a) O(p(n))
b) O(p( n log n))
c) O(p(n2))
d) O(p(m log n))
View Answer
Answer: a
Clarification: The worst-case efficiency of solving an problem in polynomial time is O(p(n)) where p(n) is the polynomial time of input size.
2. Problems that can be solved in polynomial time are known as?
a) intractable
b) tractable
c) decision
d) complete
View Answer
Answer: b
Clarification: Problems that can be solved in polynomial time are known as tractable. Problems that cannot be solved in polynomial time are intractable.
3. The sum and composition of two polynomials are always polynomials. Answer: a 4. _________ is the class of decision problems that can be solved by non-deterministic polynomial algorithms. Answer: a 5. Problems that cannot be solved by any algorithm are called? Answer: c 6. The Euler’s circuit problem can be solved in? Answer: d 7. To which class does the Euler’s circuit problem belong? Answer: a 8. Halting problem is an example for? Answer: b 9. How many stages of procedure does a non-deterministic algorithm consist of? 10. A non-deterministic algorithm is said to be non-deterministic polynomial if the time-efficiency of its verification stage is polynomial. Answer: a 11. How many conditions have to be met if an NP- complete problem is polynomially reducible? 12. To which of the following class does a CNF-satisfiability problem belong? Answer: c 13. How many steps are required to prove that a decision problem is NP complete? Answer: b 14. Which of the following problems is not NP complete? Answer: d 15. The choice of polynomial class has led to the development of an extensive theory called ________
a) true
b) false
Clarification: One of the properties of polynomial functions states that the sum and composition of two polynomials are always polynomials.
a) NP
b) P
c) Hard
d) Complete
Clarification: NP problems are called as non-deterministic polynomial problems. They are a class of decision problems that can be solved using NP algorithms.
a) tractable problems
b) intractable problems
c) undecidable problems
d) decidable problems
Clarification: Problems cannot be solved by any algorithm are called undecidable problems. Problems that can be solved in polynomial time are called Tractable problems.
a) O(N)
b) O( N log N)
c) O(log N)
d) O(N2)
Clarification: Mathematically, the run time of Euler’s circuit problem is determined to be O(N2).
a) P class
b) NP class
c) Partition class
d) Complete class
Clarification: Euler’s circuit problem can be solved in polynomial time. It can be solved in O(N2).
a) decidable problem
b) undecidable problem
c) complete problem
d) trackable problem
Clarification: Halting problem by Alan Turing cannot be solved by any algorithm. Hence, it is undecidable.
a) 1
b) 2
c) 3
d) 4
Answer: b
Clarification: A non-deterministic algorithm is a two-stage procedure- guessing stage and verification stage.
a) true
b) false
Clarification: One of the properties of NP class problems states that A non-deterministic algorithm is said to be non-deterministic polynomial if the time-efficiency of its verification stage is polynomial.
a) 1
b) 2
c) 3
d) 4
Answer: b
Clarification: A function t that maps all yes instances of decision problems D1 and D2 and t should be computed in polynomial time are the two conditions.
a) NP class
b) P class
c) NP complete
d) NP hard
View Answer
Clarification: The CNF satisfiability problem belongs to NP complete class. It deals with Boolean expressions.
a) 1
b) 2
c) 3
d) 4
Clarification: First, the problem should be NP. Next, it should be proved that every problem in NP is reducible to the problem in question in polynomial time.
a) Hamiltonian circuit
b) Bin packing
c) Partition problem
d) Halting problem
Clarification: Hamiltonian circuit, bin packing, partition problems are NP complete problems. Halting problem is an undecidable problem.
a) computational complexity
b) time complexity
c) problem complexity
d) decision complexity
Answer: a
Clarification: An extensive theory called computational complexity seeks to classify problems according to their inherent difficulty.
