Professional Documents
Culture Documents
CT 1 - A Answer Key
CT 1 - A Answer Key
1 H H H H M L L L M M L H H H H
CO1
2 H H H H M L L L M M L H H H H
CO2
3 CO3 H H H H M L L L M M L H H H H
4 H H H H M L L L M M L H H H H
CO4
5 H H H H M L L L M M L H H H H
CO5
6 H H H H M L L L M M L H H H H
CO6
Part – A
Answer all (5 x 1=5 marks)
Q. Question Mark B C P PI
N s L O O Cod
o e
1 Match the following: 1 2 1 3 3.6.1
a) Push down automata i) Regular expression
b) Finite State Machines ii) Context free grammar
c) Syntax analysis iii) Lexeme
d) Forward pointer iv) Parse tree
a) A-ii; b-i;c-iv; d-iii
b) A-i; b-ii;c-iv; d-iii
c) A-ii; b-i;c-iii; d-iv
d) A-ii; b-iii;c-iv; d-i
Ans: a
2 _______ is the maximum number of states that an ε-NFA can have on ε 1 2 1 3 3.6.1
moves.
a) n
b) 0
c) Infinite
d) 1
Ans: c
3 What is the length of the improper substring of “equivalent”? 1 2 1 3 3.6.1
a) 10
b) 9
c) 8
d) 11
Ans: a
Ans: b
Ans: c,or d
Part –B
Answer any two (2x 4=8 marks)
Q. Question Mark B C P PI
N s L O O Cod
o e
6 Distinguish the operational difference between compiler and interpreter. Also, 4 1 1 1 1.6.1
list the tasks done by preprocessor.
Answer
Macro expansion
Conditional compilation
7 Construct a DFA which can accept the strings starting and ending with same 4 3 1 6 6.3.1
letter over the input Σ={a, b}. Also, give its formal definition.
Answer
8 Explain the role of two pointers in input buffering scheme with a neat 4 2 1 6 6.3.1
diagram.
Answer
The forward ptr moves ahead to search for end of lexeme. As soon as
the blank space is encountered, it indicates end of lexeme. The fp will
be moved ahead at white space, when fp encounters white space, it
ignore and moves ahead. then both the lexeme pointer and forward
ptr(fp) are set at next token.
Part –C
Answer all ( 1x 12=12 marks)
Q. Question Mark B C P PI
N s L O O Code
o
9 a) Convert the following RE=a(a|b)*abb to DFA using subset 12 4 1 6 6.3.1
construction method and minimize it.
Answer
(OR)
b) Describe the various phases of compiler and trace it with the
program segment
(a: = b + real * 60).
Answer