What is Polish notation? Explain with an example.

2025

What is Polish notation? Explain with an example.

Show answer & explanation

Concept

Polish notation, also called prefix notation, places an operator before its operands. Because the operator appears first and each operator has a fixed arity, the expression can be interpreted without precedence rules or parentheses.

Application

  1. Take the infix expression (A + B) × C.

  2. Convert the parenthesized sum A + B to prefix form: + A B.

  3. Place the multiplication operator before that result and C: × + A B C.

  4. Reading from left to right, × receives the result of + A B as its first operand and C as its second operand.

Cross-check

With A = 2, B = 3, and C = 4, the prefix expression evaluates + A B to 5 and then × 5 C to 20. The original infix expression (2 + 3) × 4 also equals 20.

Therefore, Polish notation represents (A + B) × C as × + A B C.

Explore the full course: Up Lt Grade Assistant Teacher 2025

Loading lesson…