Consider the parse tree
Assume that $*$ has higher precedence than $+$, $-$ and operators associate right to left (i.e $(a + b + c= (a + (b + c)))$. Consider
The parse tree corresponds to
@srestha Ma'am
I don't know whether they expect "most appropriate" answer or not but I think there is no need of choice 3 if choice 4 is sufficient. as "*" has highest precedence then anyhow it wont perform "+" over "*" so no need of parentheses there. Please explain.
"*" has highest precedence then anyhow it wont perform "+" over "*"
that is true, that is why option iv is true
but iii also correct
if both are correct, we need to say both correct. We cannot eliminate one without any reason
e is correct Because as the precedence is right to left, expression evaluated in (ii) is $2+(a-((b*a)+b)),$ which is not a correct evaluation as the given parse tree.
64.3k questions
77.9k answers
244k comments
80.0k users