UGC NET CS 2008 Dec-Paper-2
January 20, 2024UGC NET CS 2008 Dec-Paper-2
January 20, 2024ISRO CS-2023
Question 1 |
Consider the context-free grammar G below for arithmetic expressions :
E->E+E|E*E|id
Which of the following statements is TRUE:
The string “id + id x id” has no parse tree according to G
| |
The string “id + id x id” has only one parse tree according to G | |
The string “id + id x id” has exactly two parse trees according to G
| |
The string “id + id x id” has more than two parse trees according to G |
Correct Answer: C
E=E+E=E+E*E=id+id*id
Also reverse .so, parse trees=2