Explore topic-wise MCQs in Compilers.

This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.

1.

The set of all strings over ? = {a,b} in which all strings having bbbb as substring is

A. (a+
B. * bbbb (a+b)*b) (a+b)* bb (a+b)*bb
C. bbb(a+b)*
D. bb (a+b)*
Answer» B. * bbbb (a+b)*b) (a+b)* bb (a+b)*bb
2.

Which of the following languages is/are regular?L1: {wxwR ? w, x ? {a, b}* and ?w?, ?x? >0} wR is the reverse of string wL2: {anbm ?m ? n and m, n=0L3: {apbqcr ? p, q, r = 0}

A. L1 and L3 only
B. L2
C. L2 and L3 only
D. L3 only
Answer» B. L2
3.

Which of the following pairs of regular expression are equivalent?

A. 1(01)* and (10)*1
B. X(xx)* and (xx)*x
C. None of the mentioned
D. Both of the mentioned
Answer» E.
4.

Consider alphabet ? = {0, 1}, the null/empty string ? and the sets of strings X0, X1 and X0.How are X1 and X2 are related ?X0 = 1 X1X1 = 0 X1 + 1 X2X2 = 0 X1 + {?}Which one of the following represents the strings in X0?

A. 10 (0* + (10)*)1
B. 10 (0* + (10)*)*1
C. 10 (0* + (10)*)*1
D. 10 (0 + 10)*1 + 110 (0 + 10)*1
Answer» D. 10 (0 + 10)*1 + 110 (0 + 10)*1
5.

Which of the following identity is true?

A. ? +RR* = R* = ? + R*R
B. (R1R2)*R1 = R1 (R2R1)*
C. R*R* = R*
D. All of the mentioned
Answer» E.
6.

How many minimum states are required to find whether a string has odd number of 0's or not?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
7.

The set of all strings over ? = {a,b} in which strings consisting a's and b's and ending with in bb is

A. ab
B. a*bbb
C. (a+b)* bb
D. All of the mentioned
Answer» D. All of the mentioned
8.

Assume the statements S1 and S2 given as :S1 : Given a context free grammar, there exists an algorithm for determining whether L(G) is infinite.S2 : There exists an algorithm to determine whether two context free grammars generate the same language.Which of the following is true ?

A. S1 is correct and S2 is not correct
B. Both S1 and S2 are correct
C. Both S1 and S2 are not correct
D. S1 is not correct and S2 is correct
Answer» B. Both S1 and S2 are correct
9.

The string (

A. |((
B. *(
C. ) is equivalent toa) Emptyb) abcabcc) b*c|a
D. None of the mentioned
Answer» D. None of the mentioned