Saturday, 18 November 2017

Infix Postfix Prefix

Algebraic Expressions



An algebraic expression can be defined as follows...

An algebraic expression is a combination of operands and operators that represents a specific value.

Example : A = B + C; denote an expression in which there are 3 operands A, B, C and two operator + and =

An operator is a symbol that tells the computer to perform certain mathematical or logical manipulations. Operators are used in program to manipulate data and variables

Operands are the values on which the operators can perform the task.

Types of Algebric Expression

An algebraic expression can be represented in three different ways based on the operator position. They are as follows...


  1. Prefix Expression
  2. Infix Expression
  3. Postfix Expression


Prefix Expression

In prefix expression, operator is used before operands. We can say that "the operator precedes both Operands".

The general structure of Prefix expression is as follows...

Operator Operand1 Operand2

Example

Infix Expression

In infix expression, operator is placed in between the operands.

The general structure of an Infix expression is as follows...

Operand1 Operator Operand2

Example

Postfix Expression

In postfix expression, the operator is placed after the operands. We can say that "Operator follows both Operands".

The general structure of Postfix expression is as follows...

Operand1 Operand2 Operator

Example



Any expression can be represented using the above three different types of expressions. And we can convert an expression from one form to another form like Infix to Postfix, Infix to Prefix, Prefix to Postfix and vice versa.



Share this

0 Comment to "Infix Postfix Prefix"

Post a Comment