Loading, please wait...

EXPRESSION PARSING

Arithmetic expression is known as a notation. Following are the notations for writing arithmetic expression in different ways but having same notations. It means without affecting the essence or output for an expression.

  1. Prefix (Polish) Notation
  2. Infix Notation
  3. Postfix(Reverse-Polish) Notation

 

Prefix Notations In this the operator symbols are placed before its operands. The main property of this Notations is that the order in which operations are to be performed is ascertained by the position of the operators and operands in the expressions.

For Example: 

+AB

 

Infix Notations In this operator symbols are placed between the operands. Infix notation sometimes can be difficult and costly in the terms of time and memory space.

For Example: 

A + B

 

Postfix Notations In this the operator symbols are placed after its operands. This is also known as Reverse Polish Notation.

For Example: 

AB +

 

Example:

 

Infix Notation

Prefix Notation

Postfix Notation

A + B

+AB

AB+

(A-C) *B

*-ACB

AC-B*

A + (B*C)

+A*BC

ABC*+

(A+B)/(C-D)

/+AB-CD

AB+CD-/

(A+(B*C))/(C-(D*B))

/+A*BC-C*DB

ABC*+CDB*-/