Notations For Arthmatic Expression

 Polish notation (or) prefix notation and expressions Converse

Polish notation are also known as a prefix notation is defined as in this notation system operator is written before the operands, Example of polish and notations or prefix notations is +AB or /CD.

   Based on the operator position ,expressions are divided into three types . They are as follows.

  1. Infix expression 
  2. Postfix expressions 
  3. Prefix expression

Infix expression

In infix expression ,operators is used in between operands. The general structure of an infix expression is as follows .

Operand1 operator Operand2

>>Operators are written in between their operations .

>>This is used in our common mathematical expression .

  The operators forward of evolution are preformed from left to right and it obeys precedence rules i.e multiplication and division are performed before addition and subtraction. 

>>Bracket can be used to change the order of evolution .

Ex :-

a)A + B

b)x*(y+z)

c)(a+b)

Postfix Notation

>>In postfix expression operator is used after operations ,we can say that "operator follows the operands".

The general structure of postfix expression is as follows .

Operand1 operand2 opera ter2

>>Operators are written after their operators .

>>The order of evolution of operator is always from right to left .

>>Bracket cannot be used to changes the order of evaluation .

Ex:-

a)AB+.     b)xyz+*.        c)ab+

Prefix notations( Polish notations)

>>In prefix expression operator is used before operands, we can say that "operate in follows the operator"

>>The general structure of the prefix expression is as follow .

Operator Operand1 Operand2

>>Operators are written before their operands.

>>Order of evolution from left to right.

Ex:- a)+AB.        b)*x+yz.          c)+ab


Comments

Popular posts from this blog

History of C language

Lab programs of C

Algorithm Pseudopods Flow-chat