Answer : Option CExplaination / Solution:
Lemical Analyzer uses DFA to recognize the longest possible input sequence that makes up a
token. Parser takes input in the form of tokens and usually builds a data structure in the form
of parse tree. Here parse tree can be termed as a Production tree as parser uses production of
the grammar to check whether generated tokens form a meaningful compression).
Register allocation can be reduced to K-colouring problem where K is the number of registers
available on the target architecture.
Post order traversal of expression tree gives postfix notation for a given expression & this
post fix notation can be evaluated using stack.
Q3.Consider the alphabet ∑ = {0.1},
the null/empty string λ and the sets of strings
X0 , X1 , and
X2 generated by the corresponding non-terminals of regular grammar. X0, X1, and X2 are
related as follows:
X0 = 1X1
X1 = 0X1 + 1X2
X2 = 0X1 + {λ}
Which one of the following choices precisely represents the strings in X0?
Answer : Option CExplaination / Solution: No Explaination.
Q6. Which of the following decision problems are undecidable?
I. Given NFAs N1 and N2, is L(N1) ∩ L(N2) = Φ?
II. Given a CFG G = (N, Σ, P, S) and a string x ∈ Σ∗, does x ∈ L(G)?
III. Given CFGs G1 and G2, is L(G1) = L(G2)?
IV. Given a TM M, is L(M) = Φ?
Answer : Option CExplaination / Solution:
There is no known algorithm to check whether the language accepted by TM is empty.
Similarly there is no algorithm to check whether language CFG’s are equivalent.
Q7.Which one of the following regular expressions represents the language: the set of all binary
strings having two consecutive 0s and two consecutive 1s?
Answer : Option BExplaination / Solution:
(a) contains 00 & 11 consecutively which is not the required condition.
(c) Doesn’t guaranty that both 00 & 11 will be present in the string.
(d) Says string should start with 11 & ends with 00 or vice versa.
Q9.Consider the transition diagram of a PDA given below with input alphabet Σ = {a, b} and
stack alphabet Γ = {X , Z}. Z is the initial stack symbol. Let L denote the language accepted
by the PDA.
Which one of the following is TRUE?
Answer : Option DExplaination / Solution: No Explaination.