Question 9784 – GATE 2001
December 14, 2023UGC NET CS 2013 Dec-paper-2
December 14, 2023GATE 2009
Question 12 |
S→aSa|bSb|a|b
The language generated by the above grammar over the alphabet {a,b} is the set of
all palindromes. | |
all odd length palindromes. | |
strings that begin and end with the same symbol. | |
all even length palindromes. |
Question 12 Explanation:
From the grammar, we can easily infer that it generates all the palindromes of odd length, for ex: strings {aba, bab, aaa, bbb, ….}
Correct Answer: B
Question 12 Explanation:
From the grammar, we can easily infer that it generates all the palindromes of odd length, for ex: strings {aba, bab, aaa, bbb, ….}
Subscribe
Login
0 Comments