← 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?
- A.Treat it exactly like a right-linear grammar
- B.It cannot be converted to an automaton
- C.Reverse the bodies to get a right-linear grammar for the reverse language, build its NFA, then reverse the NFA
- 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 →