Examveda

Suppose X is the starting symbol of the given grammar with the following transition rules. Compute the value of X as the root of the parse tree for the expression: 3 & 4 % 7.
X → X1 & B | B {X.value = X1.value + B.value, X.value = B.value}
B → B1 % D | D {B.value = B1.value * D.value, B.value = D.value}
D → num {D.value = num.value}

A. 31

B. 32

C. 33

D. 34

Answer: Option A


This Question Belongs to Data Structure >> Trees In Data Structures

Join The Discussion

Related Questions on Trees in Data Structures