Application of Stacks
Expression
Notations
1.Infix Notation
2.Prefix Notation
3.Postfix Notation
Infix
Expression
§Infix
Expression: The Operators are placed between the Operands
§Example:
A + B
§A,B
are Operands and + is Operator
Postfix
Expression
•fix ExpressionPost: The Operator s are placed after the Operands
•+ is placed after the Operands
•Also Known as Reverse
Polish Notation or Suffix notation.
•Postfix notation is another way of writing arithmetic
expressions.
•In postfix notation, the operator is written after the two
operands.
infix: 2+5 postfix: 2 5 +
Operator
Priorities
This is done by assigning operator prio.rities.
^ *
/ + -
No comments:
Post a Comment