Chapter 11: Q22E (page 784)
Draw the ordered rooted tree corresponding to each of these arithmetic expressions written in prefix notation. Then write each expression using infix notation.
- \({\bf{ + }} * {\bf{ + - 53214}}\)
- \( \uparrow {\bf{ + }}23{\bf{ - }}51\)
- \( * {\bf{/93 + }} * {\bf{24 - 76}}\)
Short Answer
a) Therefore, the infix notation of the expression is \(\left( {\left( {\left( {\left( {5 - 3} \right) + 2} \right) * 1} \right) + 4} \right)\) and its ordered rooted tree is shown below.
b) Hence, the infix notation of the expression is \(\left( {\left( {{\bf{2 + 3}}} \right) \uparrow \left( {{\bf{5 - 1}}} \right)} \right)\) and its ordered rooted tree is shown below.
c) So, the infix notation of the expression is \(\left( {\left( {9/3} \right) * \left( {\left( {2 * 4} \right){\bf{ + }}\left( {7{\bf{ - }}6} \right)} \right)} \right)\) and its ordered rooted tree is shown below.