Question:easy

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

Show Hint

Convert each bracket to postfix first: AB+ and CD-. Then put * after both.
Updated On: Oct 1, 2026
  • A B + C D - *
  • A B * C D + -
  • A B - C D * +
  • A B C * + D -
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Idea:
We can also use the stack method for infix to postfix conversion. Operands go straight to the output. Operators wait on a stack, and a closing bracket pops operators until the matching opening bracket.

Step 2: Scan the expression from left to right (first bracket).
Open bracket: push on stack.
$A$: output is $A$.
$+$: push on stack.
$B$: output is $A\,B$.
Close bracket: pop $+$ to output, so output is $A\,B\,+$. Remove the open bracket.

Step 3: Continue (second bracket).
$*$: push on stack.
Open bracket: push on stack.
$C$: output is $A\,B\,+\,C$.
$-$: push on stack.
$D$: output is $A\,B\,+\,C\,D$.
Close bracket: pop $-$ to output, so output is $A\,B\,+\,C\,D\,-$. Remove the open bracket.

Step 4: Empty the stack.
At the end, pop the remaining $*$. The output becomes:
\[ A\,B\,+\,C\,D\,-\,* \]

Step 5: Compare with the options.
This matches option 1. The other options have a different operator order, so they describe other expressions.

Step 6: Conclusion.
Option 1 is correct. \[ \boxed{A\,B\,+\,C\,D\,-\,*} \]
Was this answer helpful?
0


Questions Asked in CUET (UG) exam