‹ Back to the paper
Convert the following infix notation to postfix form:
Convert the following infix notation to postfix form:
$( A + B * C ) – ( E * F / H ) + J$
Answer
Answer
AI$(A+B*C) - (E*F/H) + J$
Using operator precedence ($*$, $/$ before $+$, $-$) and left-to-right evaluation, and converting bracket by bracket:
$(A+B*C) \to A\ B\ C\ *\ +$
$(E*F/H) \to E\ F\ *\ H\ /$
Combining with $-$ and then $+J$:
Postfix: $A\ B\ C\ *\ +\ E\ F\ *\ H\ /\ -\ J\ +$
From ISC 2019 Computer Science Paper 1, question 2(c).