MCQOPTIONS
Saved Bookmarks
This section includes 6 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 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. | i, ii, iii, iv |
| B. | i, ii |
| C. | ii, iii, iv |
| D. | iii, ivView Answer |
| Answer» E. | |
| 3. |
Given the language L = {ab, aa, baa}, whih of the following strings are in L*? |
| A. | i, ii and iii |
| B. | ii, iii and iv |
| C. | i, ii and iv |
| D. | i, iii and ivView Answer |
| Answer» D. i, iii and ivView Answer | |
| 4. |
What is the complement of the language accepted by the NFA shown below? Assume ∑ = {a} and ε is the empty string. |
| A. | Φ |
| B. | ε |
| C. | a |
| D. | {a, ε} |
| Answer» C. a | |
| 5. |
Is empty string a valid input in Ndfa. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 6. |
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 | |