GATE Computer ScienceModerateGATE CSE · UGC NET
What is the number of states in the minimal DFA for the regular expression (a|b)*abb?
- A. 3
- B. 4
- C. 5
- D. 6
Correct answer: B. 4
The DFA tracks the longest suffix of the input that is a prefix of abb: states ε, a, ab, abb, so 4 states, and no two are equivalent.
More Compiler Design questions
- Three-address code (at most one operator per instruction, the last instruction assigning to x) is generated for x = ab + c(d − e) − f/g…
- With ^ right-associative and higher than which is higher than + and − (both left-associative), what is the postfix form of a − b c ^ d ^ e…
- Consider this three-address code: 1: i = 0; 2: s = 0; 3: if i >= n goto 9; 4: t = a[i]; 5: if t < 0 goto 7; 6: s = s + t; 7: i = i + 1; 8…
- Using E → E + T | T; T → T F | F; F → id, how many reductions does a bottom-up parser perform for the input id + id id?
- In the grammar S → A B c | d; A → B B | a; B → b | ε; C → A C | ε, how many non-terminals are nullable?
- For the grammar S → A B; A → a A | b | ε; B → a B | b A | ε, how many cells of the LL(1) parsing table contain more than one production?