GATE 2007 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2007

184 questions

MCQ 1841-mark 184

Questions 121–125 of 184

Q121Parsing1 markMCQ−0.33 if wrong
Consider the grammar given below:
S→x B∣y AS \rightarrow x \ B \mid y \ A
A→x∣x S∣y A AA \rightarrow x \mid x \ S \mid y \ A \ A
B→y∣y S∣x B BB \rightarrow y \mid y \ S \mid x \ B \ B

Consider the following strings.
i. xxyyx
ii. xxyyxy
iii. xyxy
iv. yxxy
v. yxx
vi. xyx
Which of the above strings are generated by the grammar ?

Q122Parsing1 markMCQ−0.33 if wrong
Consider an ambiguous grammar G and its disambiguated version D. Let the language recognized by the two grammars be denoted by L(G) and L(D) respectively. Which one of the following is true?

Q123Parsing1 markMCQ−0.33 if wrong
Consider the CFG with {S, A,B} as the non-terminal alphabet, {a,b} as the terminal alphabet, S as the start symbol and the following set of production rules:
S→\rightarrow aB S→\rightarrowbA
B→\rightarrow b A →\rightarrowa
B→\rightarrow bS A →\rightarrowaS
B→\rightarrow aBB A →\rightarrowbAA

For the string "aabbab", how many derivation trees are there?

Q124Parsing1 markMCQ−0.33 if wrong
Consider the CFG with {S, A,B} as the non-terminal alphabet, {a,b} as the terminal alphabet, S as the start symbol and the following set of production rules:
S→\rightarrow aB S→\rightarrowbA
B→\rightarrow b A →\rightarrowa
B→\rightarrow bS A →\rightarrowaS
B→\rightarrow aBB A →\rightarrowbAA

Which of the following strings is generated by the grammar?

Q125Parsing1 markMCQ−0.33 if wrong
Consider the grammar with non-terminals N={S,C,S1S,C,S_1}, terminals T={a,b,i,t,e}, with S as the start symbol, and the following set of rules:

S→iCtSS1∣aS\rightarrow iCtSS_{1}|a
S1→eS∣ϵS_{1}\rightarrow eS|\epsilon
C→bC \rightarrow b

The grammar is NOT LL(1) because: