Postfix Notation | Compiler design

2,517 views 6 slides Jul 24, 2018
Slide 1
Slide 1 of 6
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6

About This Presentation

compiler design | postfix notation. all about postfix notations with algorithm and example.


Slide Content

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