Skip to content
Related Articles

Related Articles

GATE | Gate IT 2005 | Question 6
  • Last Updated : 21 Dec, 2015

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)

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


My Personal Notes arrow_drop_up
Recommended Articles
Page :