Correct option is D
Step-by-Step Conversion:
Infix expression:
A * (B-C)
Step 1: Identify the operators and operands
- B - C is evaluated first (inside parentheses)
- Result is then multiplied by A
Step 2: Convert from infix to prefix (operator before operands)
- B - C → - B C
- A * (B - C) → * A - B C
So, the correct prefix expression is:
*A - BC
Important Key Points:
- Prefix notation (Polish notation) places the operator before its operands.
- Brackets in infix expressions help determine operation priority.
- Conversion to prefix involves recursively processing operators inside out, maintaining precedence.
Knowledge Booster:
- A B C * -: This is in postfix (Reverse Polish Notation) form, not prefix.
- - A * B C: Incorrect operator placement; does not reflect correct grouping.
- * - A B C: Incorrect operand order — A is multiplied, not subtracted.