MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Compilers knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
For the following grammar: S → A | B | 2 A → C0 | D B → C1 | E C → D | E | 3 D → E0 | S E → D1 | S Identify all the unit pairs. |
| A. | D,C |
| B. | A,B |
| C. | B,C |
| D. | A,C |
| Answer» B. A,B | |
| 2. |
The grammar G: S → SS | a | b is ambiguous. Check all and only the strings that have exactly two leftmost derivations in G. |
| A. | bbb |
| B. | ab |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 3. |
The parse tree below represents a rightmost derivation according to the grammar S → AB, A → aS|a, B → bA. Which of the following are right-sentential forms corresponding to this derivation? |
| A. | aAbAba |
| B. | aababa |
| C. | aABba |
| D. | aSba |
| Answer» C. aABba | |
| 4. |
Here is a context-free grammar G: S → AB A → 0A1 | 2 B → 1B | 3A which of the following strings are in L (G)? |
| A. | 021300211 |
| B. | 022111300211 |
| C. | None of the mentioned |
| D. | 021300211 & 022111300211 |
| Answer» E. | |
| 5. |
If is a language, and is a symbol, then, the quotient of and, is the set of strings such that is in: is in. Suppose is regular, which of the following statements is true? |
| A. | L/a is always a regular language |
| B. | L/a is not a regular language |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» B. L/a is not a regular language | |
| 6. |
Which grammar is not regular? |
| A. | 0^n |
| B. | 0^n 1^n n |
| C. | 0^m 0^n n |
| D. | 0^n 0^n n |
| Answer» B. 0^n 1^n n | |
| 7. |
Which of the following strings is NOT in the Kleene star of the language {011, 10, 110}? |
| A. | 01 |
| B. | 10 |
| C. | 110 |
| D. | 10011101 |
| Answer» E. | |
| 8. |
Find the pair of regular expressions that are equivalent. |
| A. | (0+1)* and (0*+1*)* |
| B. | (0+1)* and (0+1*)* |
| C. | (0+10)* and (0*+10)* |
| D. | All of the mentioned |
| Answer» E. | |
| 9. |
If string s is accepted by this DFA, which of these strings cannot be suffix of s? |
| A. | 111001 |
| B. | 111111 |
| C. | 111000 |
| D. | 101010 |
| Answer» B. 111111 | |
| 10. |
Examine the following DFA: If input is 011100101, which edge is NOT traversed? |
| A. | A B |
| B. | C |
| C. | C D |
| D. | D A |
| Answer» D. D A | |