SlideShare a Scribd company logo
TO OUR
PRESENTATI
ON
WElcOmE…WElcOmE…
Submitted By
FASTER
GROUP
Group Members
Content
Prefix, Postfix, Infix
Notation
Infix Notation
To add A, B, we write
A+B
To multiply A, B, we write
A*B
The operators ('+' and '*') go in
between the operands ('A' and 'B')
This is "Infix" notation.
Prefix Notation
Instead of saying "A plus B", we could
say "add A,B " and write
+ A B
"Multiply A,B" would be written
* A B
This is Prefix notation.
Postfix Notation
Another alternative is to put the
operators after the operands as in
A B +
and
A B *
This is Postfix notation.
The terms infix, prefix, and postfix
tell us whether the operators go
between, before, or after the
operands.
Parentheses
Evaluate 2+3*5.
+ First:
(2+3)*5 = 5*5 = 25
* First:
2+(3*5) = 2+15 = 17
Infix notation requires Parentheses.
What about Prefix Notation?
+ 2 * 3 5 =
= + 2 * 3 5
= + 2 15 = 17
* + 2 3 5 =
= * + 2 3 5
= * 5 5 = 25
No parentheses needed!
Postfix Notation
2 3 5 * + =
= 2 3 5 * +
= 2 15 + = 17
2 3 + 5 * =
= 2 3 + 5 *
= 5 5 * = 25
No parentheses needed here either!
Conclusion:
Infix is the only notation that
requires parentheses.
Why all this
At our level, we cannot evaluate an
infix expression, but we can turn an
infix evaluation into a prefix or
postfix expression and then evaluate
them.
What we did
We took infix expression and turned
them into postfix expression.
Simple way to convert Infix Postfix......
Now we want show how we can
convert Infix to Postfix using stack.
Now we will see a little bit complex
Example which contain parentheses.
Infix to Postfix
( ( A + B ) * ( C - E ) ) / ( F + G ) )
stack: (
output: []
Infix to Postfix
( A + B ) * ( C - E ) ) / ( F + G ) )
stack: ( (
output: []
Expression evaluation
Infix to Postfix
A + B ) * ( C - E ) ) / ( F + G ) )
stack: ( ( (
output: []
Expression evaluation
Infix to Postfix
+ B ) * ( C - E ) ) / ( F + G ) )
stack: ( ( (
output: [A]
Expression evaluation
Infix to Postfix
B ) * ( C - E ) ) / ( F + G ) )
stack: ( ( ( +
output: [A]
Infix to Postfix
) * ( C - E ) ) / ( F + G ) )
stack: ( ( ( +
output: [A B]
Expression evaluation
Infix to Postfix
* ( C - E ) ) / ( F + G ) )
stack: ( (
output: [A B + ]
Infix to Postfix
( C - E ) ) / ( F + G ) )
stack: ( ( *
output: [A B + ]
Infix to Postfix
C - E ) ) / ( F + G ) )
stack: ( ( * (
output: [A B + ]
Infix to Postfix
- E ) ) / ( F + G ) )
stack: ( ( * (
output: [A B + C ]
Infix to Postfix
E ) ) / ( F + G ) )
stack: ( ( * ( -
output: [A B + C ]
Infix to Postfix
) ) / ( F + G ) )
stack: ( ( * ( -
output: [A B + C E ]
Infix to Postfix
) / ( F + G ) )
stack: ( ( *
output: [A B + C E - ]
Infix to Postfix
/ ( F + G ) )
stack: (
output: [A B + C E - * ]
Infix to Postfix
( F + G ) )
stack: ( /
output: [A B + C E - * ]
Infix to Postfix
F + G ) )
stack: ( / (
output: [A B + C E - * ]
Infix to Postfix
+ G ) )
stack: ( / (
output: [A B + C E - * F ]
Infix to Postfix
G ) )
stack: ( / ( +
output: [A B + C E - * F ]
Infix to Postfix
) )
stack: ( / ( +
output: [A B + C E - * F G ]
Infix to Postfix
)
stack: ( /
output: [A B + C E - * F G + ]
Infix to Postfix
stack: <empty>
output: [A B + C E - * F G + / ]
Done!!!
Expression evaluation
Expression evaluation
Thank’s to all
THE END
By Mahadi

More Related Content

What's hot (20)

PPTX
Huffman codes
Nargis Ehsan
 
PPT
Infix prefix postfix
Self-Employed
 
PPTX
Data Structures - Lecture 10 [Graphs]
Muhammad Hammad Waseem
 
PPT
Stack a Data Structure
ForwardBlog Enewzletter
 
PPTX
Polymorphism in c++(ppt)
Sanjit Shaw
 
PPTX
Queue in Data Structure
Janki Shah
 
PPTX
Pointers in c++
Vineeta Garg
 
PPTX
Queue ppt
SouravKumar328
 
PPTX
BNF & EBNF
AshaniDickowita
 
PPT
Stacks
sweta dargad
 
PPTX
Abstract Data Types
karthikeyanC40
 
PPT
Data structures using c
Prof. Dr. K. Adisesha
 
PPTX
Queue Implementation Using Array & Linked List
PTCL
 
PPTX
Data Structures and Algorithm - Module 1.pptx
EllenGrace9
 
PPTX
Linear Search Presentation
Markajul Hasnain Alif
 
PPT
BINARY TREE REPRESENTATION.ppt
SeethaDinesh
 
PPT
Top down parsing
ASHOK KUMAR REDDY
 
PPTX
Queue - Data Structure - Notes
Omprakash Chauhan
 
PPTX
Sorting Algorithms
Pranay Neema
 
PDF
Applications of stack
eShikshak
 
Huffman codes
Nargis Ehsan
 
Infix prefix postfix
Self-Employed
 
Data Structures - Lecture 10 [Graphs]
Muhammad Hammad Waseem
 
Stack a Data Structure
ForwardBlog Enewzletter
 
Polymorphism in c++(ppt)
Sanjit Shaw
 
Queue in Data Structure
Janki Shah
 
Pointers in c++
Vineeta Garg
 
Queue ppt
SouravKumar328
 
BNF & EBNF
AshaniDickowita
 
Stacks
sweta dargad
 
Abstract Data Types
karthikeyanC40
 
Data structures using c
Prof. Dr. K. Adisesha
 
Queue Implementation Using Array & Linked List
PTCL
 
Data Structures and Algorithm - Module 1.pptx
EllenGrace9
 
Linear Search Presentation
Markajul Hasnain Alif
 
BINARY TREE REPRESENTATION.ppt
SeethaDinesh
 
Top down parsing
ASHOK KUMAR REDDY
 
Queue - Data Structure - Notes
Omprakash Chauhan
 
Sorting Algorithms
Pranay Neema
 
Applications of stack
eShikshak
 

Viewers also liked (9)

PPT
Conversion of Infix To Postfix Expressions
Kulachi Hansraj Model School Ashok Vihar
 
PDF
Infix to Prefix (Conversion, Evaluation, Code)
Ahmed Khateeb
 
PPTX
My lecture infix-to-postfix
Senthil Kumar
 
PDF
Infix prefix postfix expression -conversion
Syed Mustafa
 
PPTX
Infix-Postfix expression conversion
Rashmiranja625
 
DOCX
Conversion from infix to prefix using stack
Haqnawaz Ch
 
PPTX
Infix to postfix
Saeed Farooqi
 
DOC
Infix to-postfix examples
mua99
 
PPTX
Infix to postfix conversion
Then Murugeshwari
 
Conversion of Infix To Postfix Expressions
Kulachi Hansraj Model School Ashok Vihar
 
Infix to Prefix (Conversion, Evaluation, Code)
Ahmed Khateeb
 
My lecture infix-to-postfix
Senthil Kumar
 
Infix prefix postfix expression -conversion
Syed Mustafa
 
Infix-Postfix expression conversion
Rashmiranja625
 
Conversion from infix to prefix using stack
Haqnawaz Ch
 
Infix to postfix
Saeed Farooqi
 
Infix to-postfix examples
mua99
 
Infix to postfix conversion
Then Murugeshwari
 
Ad

Similar to Expression evaluation (20)

PPTX
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
PPTX
DS1.pptx
Momin24
 
PDF
1.3- infix-ti-postfix.pdf
soniasharmafdp
 
PPTX
STACK APPLICATIONS: INFOX TO POSTFIX CONVERSION AND EVALUATION OF POSTFIX EXP...
devismileyrockz
 
PPTX
Stack and queue
Shakila Mahjabin
 
PPTX
week9-prefixinfixandpostfixnotations-191013065821.pptx
ssusere3b1a2
 
PPT
Application of Stacks
Ain-ul-Moiz Khawaja
 
PPTX
Prefix, Infix and Post-fix Notations
Afaq Mansoor Khan
 
PPTX
Data Structures and Agorithm: DS 08 Infix to Postfix.pptx
RashidFaridChishti
 
PPTX
Stack Data Structure Intro and Explanation
RitikaLohiya2
 
PPTX
Prefix and PostFIx presentation for DSA .pptx
rtiwary190801
 
PPT
Circular queues
Ssankett Negi
 
PPT
Infix to Postfix Conversion Using Stack
Soumen Santra
 
PPTX
Data structures
Rokonuzzaman Rony
 
PDF
C applications
faizankhan260690
 
PPTX
EXPRESSIONS.pptx
Sachin013
 
PPT
Stack Data Structure V1.0
Zidny Nafan
 
PDF
Please need help on C++ language.Infix to Postfix) Write a program.pdf
pristiegee
 
PPT
computer notes - Data Structures - 6
ecomputernotes
 
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
P. Subathra Kishore, KAMARAJ College of Engineering and Technology, Madurai
 
DS1.pptx
Momin24
 
1.3- infix-ti-postfix.pdf
soniasharmafdp
 
STACK APPLICATIONS: INFOX TO POSTFIX CONVERSION AND EVALUATION OF POSTFIX EXP...
devismileyrockz
 
Stack and queue
Shakila Mahjabin
 
week9-prefixinfixandpostfixnotations-191013065821.pptx
ssusere3b1a2
 
Application of Stacks
Ain-ul-Moiz Khawaja
 
Prefix, Infix and Post-fix Notations
Afaq Mansoor Khan
 
Data Structures and Agorithm: DS 08 Infix to Postfix.pptx
RashidFaridChishti
 
Stack Data Structure Intro and Explanation
RitikaLohiya2
 
Prefix and PostFIx presentation for DSA .pptx
rtiwary190801
 
Circular queues
Ssankett Negi
 
Infix to Postfix Conversion Using Stack
Soumen Santra
 
Data structures
Rokonuzzaman Rony
 
C applications
faizankhan260690
 
EXPRESSIONS.pptx
Sachin013
 
Stack Data Structure V1.0
Zidny Nafan
 
Please need help on C++ language.Infix to Postfix) Write a program.pdf
pristiegee
 
computer notes - Data Structures - 6
ecomputernotes
 
Ad

More from JeeSa Sultana (7)

PPTX
Vlsm js
JeeSa Sultana
 
PPTX
Frquency distribution & graphs js
JeeSa Sultana
 
PPTX
Semiconductor js
JeeSa Sultana
 
PPTX
Bellmanfordwith negative cycle js
JeeSa Sultana
 
PPTX
Merge sort js
JeeSa Sultana
 
PPTX
Sir jagdish chandra bose
JeeSa Sultana
 
PPTX
Nature of light
JeeSa Sultana
 
Vlsm js
JeeSa Sultana
 
Frquency distribution & graphs js
JeeSa Sultana
 
Semiconductor js
JeeSa Sultana
 
Bellmanfordwith negative cycle js
JeeSa Sultana
 
Merge sort js
JeeSa Sultana
 
Sir jagdish chandra bose
JeeSa Sultana
 
Nature of light
JeeSa Sultana
 

Recently uploaded (20)

PPTX
Basics and rules of probability with real-life uses
ravatkaran694
 
PPTX
YSPH VMOC Special Report - Measles Outbreak Southwest US 7-20-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
PDF
Tips for Writing the Research Title with Examples
Thelma Villaflores
 
PPTX
Electrophysiology_of_Heart. Electrophysiology studies in Cardiovascular syste...
Rajshri Ghogare
 
PPTX
LDP-2 UNIT 4 Presentation for practical.pptx
abhaypanchal2525
 
PDF
My Thoughts On Q&A- A Novel By Vikas Swarup
Niharika
 
PDF
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
PPTX
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Translation_ Definition, Scope & Historical Development.pptx
DhatriParmar
 
PPTX
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PDF
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
PPTX
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
PPTX
Top 10 AI Tools, Like ChatGPT. You Must Learn In 2025
Digilearnings
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PPTX
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
PPTX
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
PDF
John Keats introduction and list of his important works
vatsalacpr
 
Basics and rules of probability with real-life uses
ravatkaran694
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 7-20-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Tips for Writing the Research Title with Examples
Thelma Villaflores
 
Electrophysiology_of_Heart. Electrophysiology studies in Cardiovascular syste...
Rajshri Ghogare
 
LDP-2 UNIT 4 Presentation for practical.pptx
abhaypanchal2525
 
My Thoughts On Q&A- A Novel By Vikas Swarup
Niharika
 
TOP 10 AI TOOLS YOU MUST LEARN TO SURVIVE IN 2025 AND ABOVE
digilearnings.com
 
Gupta Art & Architecture Temple and Sculptures.pptx
Virag Sontakke
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Translation_ Definition, Scope & Historical Development.pptx
DhatriParmar
 
Unlock the Power of Cursor AI: MuleSoft Integrations
Veera Pallapu
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
Module 2: Public Health History [Tutorial Slides]
JonathanHallett4
 
Digital Professionalism and Interpersonal Competence
rutvikgediya1
 
Top 10 AI Tools, Like ChatGPT. You Must Learn In 2025
Digilearnings
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
K-Circle-Weekly-Quiz12121212-May2025.pptx
Pankaj Rodey
 
I INCLUDED THIS TOPIC IS INTELLIGENCE DEFINITION, MEANING, INDIVIDUAL DIFFERE...
parmarjuli1412
 
John Keats introduction and list of his important works
vatsalacpr
 

Expression evaluation

Editor's Notes

  • #9: &amp;quot;A,B are multiplied&amp;quot; &amp;quot;A,B are added&amp;quot;