Vidyalelo
Data Structure · Q48

Trees in Data Structures

Programming · Data Structure · question 48

Q48

Consider the given syntax tree. Assume that division has the lowest precedence than addition, subtraction and multiplication. Addition and subtraction have the same precedence but more than multiplication. Which of the following expression can be given by the following syntax tree?

Consider the given syntax tree. Assume that division has the lowest precedence than addition, subtraction and multiplication. Addition and subtraction have the same precedence but more than multiplication. Which of the following expression can be given by the following syntax tree?
Trees in Data Structures mcq question image
A.
[5 / (p + q) * (q - r)]
Answer
B.
[5 * (p + q) / (q - r)]
C.
[5 + (p + q) * (q - r)]
D.
[5 / (p + q) + (q - r)]

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board