Explore topic-wise MCQs in Compilers.

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

1.

Definition of a language L with alphabet {a} is given as following. L= { ank | k > 0, and n is a positive integer constant} What is the minimum number of states needed in a DFA to recognize L?

A. k+1
B. n+1
C. 2n+1
D. 2k+1
Answer» C. 2n+1
2.

Which of the following problems occur?

A. Does a given program ever produce an output?
B. If L is a CFL, then is L’ is also context-free?
C. L’ is regular only if L is regular?
D. If L is a recursive language, then, L’ is also recursive?
Answer» E.
3.

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

A. abaabaaabaa
B. aaaabaaaa
C. baaaaabaaaab
D. baaaaabaa
Answer» D. baaaaabaa
4.

Is empty string a valid input in Ndfa

A. True
B. False
Answer» B. False
5.

The lexical analysis for a modern language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense?

A. Finite state automata
B. Deterministic pushdown automata
C. Non-deterministic pushdown automata
D. Turing machine
Answer» B. Deterministic pushdown automata