Query on associativity


Consider two binary operators ‘↑’ and ‘↓’ with the precedence of operator ↓ being lower than that of the operator ↑. Operator ↑ is right associative while operator ↓ is left associative. Which one of the following represents the parse tree for expression (7 ↓ 3 ↑ 4 ↑ 3 ↓ 2)?



B. Since the expression becomes (7_(3^(4^3)))_2. Here ^ represents the upper arrow and _ the other one. See in a parse tree the operation at the bottom of tree have to be performed first. Now I think you can get it