Theory of Computation MCQ (Multiple Choice Questions) - SchoolingAxis

Theory of Computation MCQ (Multiple Choice Questions)

 1. A grammar with more than one parse tree is called:

a. Unambiguous

b. Ambiguous

c. Regular

d. None of the mentioned


Ans- b. Ambiguous


2. The number of leaves in a parse tree with expression E*(E) where * and () are operators

a. 5

b. 2

c. 4

d. 3


Ans- a. 5


3. For the expression E*(E) where * and brackets are the operation, number of nodes in the respective parse tree are:

a. 6

b. 7

c. 5

d. 2


Ans- b. 7


4. Which among the following is the root of the parse tree?

a. Production P

b. Terminal T

c. Variable V

d. Starting Variable S


Ans- d. Starting Variable S


5. In which order are the children of any node ordered?

a. From the left

b. From the right

c. Arbitrarily

d. None of the mentioned


Ans- a. From the left


6. Which of the following statement is false in context of tree terminology?

a. Root with no children is called a leaf

b. A node can have three children

c. Root has no parent

d. Trees are collection of nodes, with a parent child relationship


Ans- a. Root with no children is called a leaf


7. The most suitable data structure used to represent the derivations in compiler:

a. Queue

b. Linked List

c. Tree

d. Hash Tables


Ans- c. Tree


8. Which of the following languages are most suitable for implement context free languages ?

a. C

b. Perl

c. Assembly Language

d. None of the mentioned


Ans- a. C


9. For the given Regular expression, the minimum number of terminals required to derive its grammar is: (011+1)(01)

a. 4

b. 3

c. 5

d. 6


Ans- b. 3


10. For the given Regular expression, the minimum number of variables including starting variable required to derive its grammar is: (011+1)(01)

a. 4

b. 3

c. 5

d. 6


Ans- c. 5

Previous Post Next Post

Responsive Ad