StreakPeaked· Practice

ExamsGATETechnical

Which of the following statements are TRUE ? 1. The problem of determining whether there exists a cycle in an undirected graph is in P. 2. The problem of determining whether there exists a cycle in a directed graph is in NP. 3. If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.

  1. 1, 2 and 3
  2. 1 and 2 only
  3. 2 and 3 only
  4. 1 and 3 only

Correct answer: 1, 2 and 3

Solution

All three statements are true: the cycle detection problem in undirected graphs can be solved in polynomial time (thus in P), the directed graph cycle problem is verifiable in polynomial time (hence in NP), and NP-Complete problems are defined by the existence of non-deterministic polynomial time algorithms.

Related GATE Technical questions

⚔️ Practice GATE Technical free + battle 1v1 →