GateAI
Asymptotic Analysis

GATE CSE 2013 · Q18

MCQ1 markEasy

Time

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 an undirected graph is in NP. 3. If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) 1, 2 and 3

Asymptotic Analysis

Let us analyze each statement:

  1. Statement 1 is TRUE: Cycle detection in an undirected graph can be solved deterministically in O(V+E)O(V + E) time using Depth First Search (DFS), Breadth First Search (BFS), or a Disjoint-Set (Union-Find) data structure. Since it runs in polynomial time on a deterministic machine, the problem is in P\text{P}.

  2. Statement 2 is TRUE: By definition, P⊆NP\text{P} \subseteq \text{NP}. Since cycle detection is in P\text{P}, it is also in NP\text{NP}.

  3. Statement 3 is TRUE: By definition, a language/problem AA is NP-Complete\text{NP-Complete} if:

    • A∈NPA \in \text{NP}, and

    • Every problem in NP\text{NP} is polynomial-time reducible to AA.

    Since A∈NPA \in \text{NP}, there exists a non-deterministic Turing machine (or non-deterministic algorithm) that decides AA in polynomial time.

All three statements 1, 2, and 3 are TRUE. Therefore, (A) is the correct option.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Asymptotic Analysis previous year question is Q18 of the GATE CSE 2013 paper. Find more GATE CSE PYQs on Asymptotic Analysis in Algorithms, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Asymptotic Analysis PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Asymptotic Analysis in GATE CSE

Asymptotic Analysis has 31 GATE CSE PYQs across 19 papers from 2011 to 2026. 15 of them are 1-mark MCQs like this one, and GATE CSE 2013 has 3.

How GATE tests Asymptotic Analysis

More from GATE CSE 2013

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2013 · Q18 · MCQ

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 an undirected graph is in NP. 3. If a problem A is NP-Complete, there exists a non-deterministic polynomial time algorithm to solve A.

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.