Compiler Design (2170701) MCQs

MCQs of Lexical Analysis

Showing 11 to 10 out of 20 Questions
11.

Regular expression for all strings starts with ab and ends with bba is.

(a)

aba*b*bba

(b)

ab(ab)*bba

(c)

ab(a+b)*bba

(d)

All of the mentioned

Answer:

Option (c)

12.

Choose the correct option for the given statement:

Statement: The DFA shown represents all strings which has 1 at second last position.

(a)

Correct

(b)

Incorrect, Incomplete DFA

(c)

Wrong proposition

(d)

May be correct

Answer:

Option (c)

13.

Which of the following does the given NFA represent?

(a)

 {11, 101} * {01}

(b)

 {110, 01} * {11}

(c)

 {11, 110} * {0}

(d)

 {00, 110} * {1}

Answer:

Option (c)

14.

Given the language L = {ab, aa, baa}, which of the following strings are in L* ?

 

1) abaabaaabaa

2) aaaabaaaa

3) baaaaabaaaab

4) baaaaabaa

(a)

1, 2, 3

(b)

2, 3, 4

(c)

1, 2, 4

(d)

1, 3, 4

Answer:

Option (c)

15.

The language accepted by this DFA is

(a)

 b*ab*ab*ab*

(b)

 (a+b)*

(c)

 b*a(a+b)*

(d)

 b*ab*ab*

Answer:

Option (c)

16.

Which of the following is an application of Finite Automaton?

(a)

Compiler Design

(b)

Grammar Parsers

(c)

Text Search

(d)

All of the mentioned

Answer:

Option (d)

17.

Which of the following do we use to form an NFA from a regular expression?

(a)

Subset Construction Method

(b)

Power Set Construction Method

(c)

Thompson Construction Method

(d)

Scott Construction Method

Answer:

Option (c)

18.

Regular expression for even length string:

(a)

(0|1)(0|1)* 

(b)

(0|1)*

(c)

(0|1)(0|1)(0|1)* 

(d)

(00|11|10|01)*

Answer:

Option (d)

19.

The reverse of (0+1)* will be

(a)

Null 

(b)

(0+1)*

(c)

(0+1) 

(d)

(0+1)(0+1)*

Answer:

Option (b)

20.

If r and s are two regular expressions then expression r+s is:

(a)

Regular expression 

(b)

Regular language

(c)

Union  

(d)

None of these

Answer:

Option (a)

Showing 11 to 10 out of 20 Questions