Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE-CS-2001 | Question 5

  • Last Updated : 28 Jun, 2021

Consider the following two statements:
GATECS2000Q4
(A) Only S1 is correct
(B) Only S2 is correct
(C) Both S1 and S2 are correct
(D) None of S1 and S2 is correct


Answer: (A)

Explanation: We can easily build a DFA for S1. All we need to check is whether input string has even number of 0’s. Therefore S1 is regular.

We can’t make a DFA for S2. For S2, we need a stack. Therefore S2 is not regular.

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :