Skip to content
Related Articles

Related Articles

Improve Article

GATE | Gate IT 2005 | Question 6

  • Last Updated : 28 Jun, 2021
Geek Week

The language {0n 1n 2n | 1 ā‰¤ n ā‰¤ 106} is

 
(A) regular
(B) context-free but not regular.
(C) context-free but its complement is not context-free.
(D) not context-free


Answer: (A)

Explanation:
The value of ā€˜nā€™ is finite.
So, only finite number of strings can be part of given language.
Therefore, we can construct a finite state automata for this language.

 
Thus, option (A) is correct.

 
Please comment below if you find anything wrong in the above post.


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