GATE Computer ScienceModerateGATE CSE · UGC NET

What is the number of states in the minimal DFA for the regular expression (a|b)*abb?

  1. A. 3
  2. B. 4
  3. C. 5
  4. 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

Exams that ask this topic