Question:

What will be the postfix equivalent of the expression $(A + B) * (C - D)$?

Show Hint

Parentheses take the highest priority in expression conversion.
Convert inner parenthesized sub-expressions first: $(A+B) \rightarrow AB+$, $(C-D) \rightarrow CD-$, then apply the outer operator $* \rightarrow AB+CD-*$.
Updated On: Sep 7, 2026
  • AB + CD - *
  • AB * CD + -
  • AB - CD * +
  • ABC * + D -
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Concept:
In an infix expression, operators are placed between operands.
In a postfix (Reverse Polish) expression, operators are placed directly after their respective operands, eliminating the need for parentheses.

Step 1: Conversion Using Infix-to-Postfix Rules:

The expression is:
\[ (A + B) * (C - D) \] We evaluate sub-expressions according to operator precedence and parentheses:
1. First, convert the parenthesized sub-expression $(A + B)$:
The infix operator $+$ moves behind operands $A$ and $B$:
$(A + B) \rightarrow AB+$
2. Second, convert the parenthesized sub-expression $(C - D)$:
The infix operator $-$ moves behind operands $C$ and $D$:
$(C - D) \rightarrow CD-$

Step 2: Combining with the Outer Multiplication Operator:

Substitute the postfix forms back into the main expression:
$(AB+) * (CD-)$
Here, $(AB+)$ is the first operand and $(CD-)$ is the second operand for the operator $*$.
Moving $*$ to the end gives:
$AB+ \; CD- \; *$
Final Answer:
The resulting postfix expression is AB + CD - *, which matches option (A).
Was this answer helpful?
0
0