🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: DFA: all 10 questions

Quiz: DFA · Question 9 of 10

How do you build a DFA for the complement of a language, given a complete DFA for it?

How do you build a DFA for the complement of a language, given a complete DFA for it?

  1. A.Reverse every arrow
  2. B.Add a new start state
  3. C.Swap accepting and non-accepting states
  4. D.Remove the trap state
Answer & explanation

Correct answer: Swap accepting and non-accepting states

Every string ends in exactly one state, so swapping F with Q − F flips every answer.

Can you get the rest right without peeking?

Take the timed Quiz: DFA quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →