The way to write arithmetic expression is known as a notation. An arithmetic expression can be written in three different but equivalent notations, i.e., without changing the essence or output of an expression. These notations are −
- Infix Notation
- Prefix (Polish) Notation
- Postfix (Reverse-Polish) Notation
Infix notation is used to write expressions, such as a – b + c, where operators are used in-between operands. It is simple for humans to read, write, and talk in infix notation, but this is not the case for computing machines. A method for processing infix notation could be complicated and time and space-consuming.
In this notation, the operator is written before the operands, i.e. the operator comes first. For instance, +ab. This corresponds to the infix notation a + b. Polish Notation is another name for prefix notation.
Reversed Polish Notation is the name given to this notation style. The operator is postfixed to the operands in this notation style, which means it is written after the operands. For instance, ab+. This corresponds to the infix notation a + b.
|Sr.No.||Infix Notation||Prefix Notation||Postfix Notation|
|1||a + b||+ a b||a b +|
|2||(a + b) ∗ c||∗ + a b c||a b + c ∗|
|3||a ∗ (b + c)||∗ a + b c||a b c + ∗|
|4||a / b + c / d||+ / a b / c d||a b / c d / +|
|5||(a + b) ∗ (c + d)||∗ + a b + c d||a b + c d + ∗|
|6||((a + b) ∗ c) – d||– ∗ + a b c d||a b + c ∗ d –|