‹ Back to the paper
Question 2(i)
2 marks
Computer ScienceISC 2025 Improvement Computer Science Paper 1ConversionData structures
Convert the following.
Convert the following infix notation to postfix form. (A*B^C) + (D*E) where B^C = B^C
Convert the following infix notation to postfix form.
(A*B^C) + (D*E) where B^C = $B^C$
Answer
Answer
$(A * B\text{\textasciicircum}C) + (D * E)$
Since ^ (exponentiation) has the highest precedence and is right-associative, evaluate B^C first: $B\ C\ \text{\textasciicircum}$
Then $A*(B\text{\textasciicircum}C) \to A\ B\ C\ \text{\textasciicircum}\ *$
$D*E \to D\ E\ *$
Combine both operands of the outer + :
Postfix: $A\ B\ C\ \text{\textasciicircum}\ *\ D\ E\ *\ +$