What is the Polish notation (Prefix form) of the given infix expression?…
2021
What is the Polish notation (Prefix form) of the given infix expression?
(A∗B+C)/(E−F∗G)
- A.
+*/ABCE*FG
- B.
/+*ABC–E*FG
- C.
/ABC+*–E*FG
- D.
+/ABC*–E*FG
Attempted by 572 students.
Show answer & explanation
Correct answer: B
To convert the infix expression (A*B+C)(E-F*G) to Polish notation (prefix form), follow these steps:
Step 1: Identify the main operators and their precedence. The expression has two main parts: (A*B+C) and (E-F*G), connected by implicit multiplication.
Step 2: Convert the first sub-expression (A*B+C). The multiplication (A*B) is evaluated first, then added to C. In prefix form, this becomes: + * A B C.
Step 3: Convert the second sub-expression (E-F*G). The multiplication (F*G) is evaluated first, then subtracted from E. In prefix form, this becomes: - E * F G.
Step 4: Combine the two parts. The entire expression is the product of the two sub-expressions, so the final prefix form is: * + * A B C - E * F G.
Note: The correct prefix form is * + * A B C - E * F G. This matches the structure of the original expression with proper operator precedence and grouping.