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)?
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)? Correct Answer <p><img alt="quesOptionImage42" src="//cdn.testbook.com/images/production/quesImages/quesOptionImage42.png"></p>
7 ↓ 3 ↑ 4 ↑ 3 ↓ 2
⇒ 7↓3 ↑ (4 ↑3) ↓ 2 as ↑ is right associative
⇒ 7 ↓ (3 ↑(4 ↑3)) ↓ 2
⇒ (7↓ (3 ↑(4 ↑3) ↓2 as ↓ is left associative
মোঃ আরিফুল ইসলাম
Feb 20, 2025