Postfix Notation
Course: Compiler Design
Presented by: Md. Shamsul huda
ID: 1537CSE00372
Index
 Definition
How Postfix Notation Works
Algorithm with Example
Definition
• Postfix Notation is a notation for writing arithmetic expressions in
which the operands appear before their operators.
How postfix notation works
• In postfix notation operator is placed after operands.
Programmatically postfix expression is easiest to parse and least
costly in terms of time and memory to evaluate.
Example: abc*+
Algorithm
Example: 3574-2^*+
Symbol Action stack
3
5
7
4
-
2
^
*
Push 3
Push 5
Push 7
Push 4
Pop 4 & 7
Push 7-4=3
Push 2
Pop 3&2
Push 3^2=9
Pop 9&5
Push 9*5=45
3
3,5
3,5,7
3,5,7,4
3,5,3
3,5,3,2
3,5,9
3,45
48+
Pop 3&45
Push 45+3=48
Answer
Thanks Everyone

Postfix Notation | Compiler design