TOC_ImpQuestion
TOC_ImpQuestion
4) Consider the following grammars and find the leftmost, rightmost derivations and parse
trees for the given string and show that the following grammars are ambiguous.
a) E-> E+E | E*E | (E) | id. Given string is “id + id * id”
5) Design a PDA to accept the following language by final state method and show the
moves made by PDA for the given string.
a) L= { w C wR | w ϵ (a+b)* where wR is reverse of w} . Given strings are
“aabCbaa’’ and “aabCbab”
b) L= {anbn | n>=1}, Given string is “aaabbb”
c) L = {w | w ϵ (a,b)* and Na(w) > Nb(w) }, Given string is “aaabb”
d) A string of balanced parentheses. Parentheses considered are ( , ) , [ , ]. Given
string is “ [ ( ) ( [ ] ) ] “
e) L= {anb2n | n>=1}, Given string is “aabbbb”