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

Quiz: Regular Grammars and Finite Automata · Question 7 of 10

How do you handle a left-linear grammar?

How do you handle a left-linear grammar?

  1. A.Treat it exactly like a right-linear grammar
  2. B.It cannot be converted to an automaton
  3. C.Reverse the bodies to get a right-linear grammar for the reverse language, build its NFA, then reverse the NFA
  4. D.Convert it to CNF first
Answer & explanation

Correct answer: Reverse the bodies to get a right-linear grammar for the reverse language, build its NFA, then reverse the NFA

Reversal maps left-linear grammars to right-linear ones; reversing the NFA undoes it.

Can you get the rest right without peeking?

Take the timed Quiz: Regular Grammars and Finite Automata quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →