← Quiz: CFG and PDA: all 10 questions
Quiz: CFG and PDA · Question 2 of 10
How many parse trees did the ambiguous grammar E → E+E | EE | id give for id+idid?
How many parse trees did the ambiguous grammar E → E+E | EE | id give for id+idid?
- A.1
- B.2
- C.3
- D.5
Answer & explanation
Correct answer: 2
(id+id)id and id+(idid) — two groupings, so it is ambiguous.
Can you get the rest right without peeking?
Take the timed Quiz: CFG and PDA quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →