SlideShare a Scribd company logo
2
Most read
Examples of Infix-to-Postfix Conversion


Infix expression:       a+b*c-d/e*f
Token   operator stack  top         postfix string

A                               a
+       +
B                               ab
*       +*
C                               ABC
-       +                       ABC*
                                ABC*+
        -
D                               ABC*+d
/       -/
E                               ABC*+de
*       -                       ABC*+de/
        -*
F                               ABC*+de/f
        -                       ABC*+de/f*
                                ABC*+de/f*-




Infix expression:              (a+b*c-d)/ (e*f)
Token   operator stack  top    postfix string

(       (
a                               a
+       (+
b                               ab
*       (+*
c                               abc
-       (+                     ABC*
        (                      ABC*+
        (-
d                               abc*+d
)                              ABC*+d-
/       /
(       /(
e                               abc*+d-e
*       /(*
f                               abc*+d-ef
)       /(                     abc*+d-ef*
/
    ABC*+d-ef*/

More Related Content

PPT
Bubble sort
PPT
Function overloading(c++)
PPTX
Method overloading
PPTX
Recursion in c++
PPTX
Super keyword in java
PPTX
Linked list
PPTX
Constructor in java
PPTX
Automata theory -RE to NFA-ε
Bubble sort
Function overloading(c++)
Method overloading
Recursion in c++
Super keyword in java
Linked list
Constructor in java
Automata theory -RE to NFA-ε

What's hot (20)

PPTX
INLINE FUNCTION IN C++
PPTX
stack & queue
PPTX
Peephole optimization techniques in compiler design
PPT
Binary Search
PPTX
Linked list
PPTX
Programming in c Arrays
PPTX
Inline function
PPTX
Lecture 21 problem reduction search ao star search
PPTX
classes and objects in C++
PPT
File handling in c
PPTX
Functions in c++
PPTX
Exception handling c++
PPTX
This keyword in java
PPTX
Call by value or call by reference in C++
PPTX
Templates in C++
PPTX
15 puzzle problem using branch and bound
PPT
1.1 binary tree
PDF
A* Search Algorithm
PPTX
Binary Search Tree
INLINE FUNCTION IN C++
stack & queue
Peephole optimization techniques in compiler design
Binary Search
Linked list
Programming in c Arrays
Inline function
Lecture 21 problem reduction search ao star search
classes and objects in C++
File handling in c
Functions in c++
Exception handling c++
This keyword in java
Call by value or call by reference in C++
Templates in C++
15 puzzle problem using branch and bound
1.1 binary tree
A* Search Algorithm
Binary Search Tree
Ad

Viewers also liked (10)

PDF
Infix prefix postfix expression -conversion
DOCX
Conversion from infix to prefix using stack
PDF
Infix to Prefix (Conversion, Evaluation, Code)
PPTX
Infix to postfix
PPTX
Infix-Postfix expression conversion
PPTX
My lecture infix-to-postfix
PPT
Conversion of Infix To Postfix Expressions
PPT
Expression evaluation
PPT
B trees in Data Structure
PPTX
Infix to postfix conversion
Infix prefix postfix expression -conversion
Conversion from infix to prefix using stack
Infix to Prefix (Conversion, Evaluation, Code)
Infix to postfix
Infix-Postfix expression conversion
My lecture infix-to-postfix
Conversion of Infix To Postfix Expressions
Expression evaluation
B trees in Data Structure
Infix to postfix conversion
Ad

Similar to Infix to-postfix examples (20)

PPTX
week9-prefixinfixandpostfixnotations-191013065821.pptx
PDF
C applications
PPTX
Prefix, Infix and Post-fix Notations
PPTX
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
PPSX
Stacks Implementation and Examples
PPTX
Stack_Application_Infix_Prefix.pptx
PDF
1.3- infix-ti-postfix.pdf
PPTX
DS1.pptx
DOCX
รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2
PPT
Parallel Prefix Adders Presentation
PPT
Infix to Postfix Conversion Using Stack
PDF
Embedded Android Workshop ESC India 2012
PPT
DOCX
KEY
Int Math 2 Section 8-6 1011
KEY
Integrated Math 2 Section 8-6
PPTX
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
PDF
Backups copias de seguridad
week9-prefixinfixandpostfixnotations-191013065821.pptx
C applications
Prefix, Infix and Post-fix Notations
2.2 stack applications Infix to Postfix & Evaluation of Post Fix
Stacks Implementation and Examples
Stack_Application_Infix_Prefix.pptx
1.3- infix-ti-postfix.pdf
DS1.pptx
รายงานการเขียนคำสั่งควบคุมแบบวนซ้ำ กลุ่ม 4 ม. 6 ห้อง2
Parallel Prefix Adders Presentation
Infix to Postfix Conversion Using Stack
Embedded Android Workshop ESC India 2012
Int Math 2 Section 8-6 1011
Integrated Math 2 Section 8-6
Arithmetic expression INFIX TO POSTFIX CONVERTION saraswathi ramalingam
Backups copias de seguridad

Recently uploaded (20)

PDF
WKA #29: "FALLING FOR CUPID" TRANSCRIPT.pdf
PPTX
just letters randomized coz i need to up
PPTX
BULAN K3 NASIONAL PowerPt Templates.pptx
DOCX
Nina Volyanska Controversy in Fishtank Live_ Unraveling the Mystery Behind th...
PPTX
wegen seminar ppt.pptxhkjbkhkjjlhjhjhlhhvg
PDF
MAGNET STORY- Coaster Sequence (Rough Version 2).pdf
PDF
Ct.pdffffffffffffffffffffffffffffffffffff
PPTX
the-solar-system.pptxxxxxxxxxxxxxxxxxxxx
PPTX
shbthd htsh htrw hw htr 5w h5e 54 y.pptx
PDF
Gess1025.pdfdadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
PPTX
TOEFL ITP Grammar_ Structure & Written Expression.pptx
DOC
NSCAD毕业证学历认证,温哥华岛大学毕业证国外证书制作申请
PDF
Keanu Reeves Beyond the Legendary Hollywood Movie Star.pdf
PDF
TAIPANQQ SITUS MUDAH MENANG DAN MUDAH MAXWIN SEGERA DAFTAR DI TAIPANQQ DAN RA...
PDF
Apresentação2 analise estrutual.hhjghjpdf
PPTX
SPARSH-SVNITs-Annual-Cultural-Fest presentation for orientation
PDF
Rakshabandhan – Celebrating the Bond of Siblings - by Meenakshi Khakat
PDF
Commercial arboriculture Commercial Tree consultant Essex, Kent, Thaxted.pdf
PDF
Between the Reels and the Revolution Enzo Zelocchi’s Unscripted Path Through ...
PPTX
Understanding Colour Prediction Games – Explained Simply
WKA #29: "FALLING FOR CUPID" TRANSCRIPT.pdf
just letters randomized coz i need to up
BULAN K3 NASIONAL PowerPt Templates.pptx
Nina Volyanska Controversy in Fishtank Live_ Unraveling the Mystery Behind th...
wegen seminar ppt.pptxhkjbkhkjjlhjhjhlhhvg
MAGNET STORY- Coaster Sequence (Rough Version 2).pdf
Ct.pdffffffffffffffffffffffffffffffffffff
the-solar-system.pptxxxxxxxxxxxxxxxxxxxx
shbthd htsh htrw hw htr 5w h5e 54 y.pptx
Gess1025.pdfdadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
TOEFL ITP Grammar_ Structure & Written Expression.pptx
NSCAD毕业证学历认证,温哥华岛大学毕业证国外证书制作申请
Keanu Reeves Beyond the Legendary Hollywood Movie Star.pdf
TAIPANQQ SITUS MUDAH MENANG DAN MUDAH MAXWIN SEGERA DAFTAR DI TAIPANQQ DAN RA...
Apresentação2 analise estrutual.hhjghjpdf
SPARSH-SVNITs-Annual-Cultural-Fest presentation for orientation
Rakshabandhan – Celebrating the Bond of Siblings - by Meenakshi Khakat
Commercial arboriculture Commercial Tree consultant Essex, Kent, Thaxted.pdf
Between the Reels and the Revolution Enzo Zelocchi’s Unscripted Path Through ...
Understanding Colour Prediction Games – Explained Simply

Infix to-postfix examples

  • 1. Examples of Infix-to-Postfix Conversion Infix expression: a+b*c-d/e*f Token operator stack  top postfix string A a + + B ab * +* C ABC - + ABC* ABC*+ - D ABC*+d / -/ E ABC*+de * - ABC*+de/ -* F ABC*+de/f - ABC*+de/f* ABC*+de/f*- Infix expression: (a+b*c-d)/ (e*f) Token operator stack  top postfix string ( ( a a + (+ b ab * (+* c abc - (+ ABC* ( ABC*+ (- d abc*+d ) ABC*+d- / / ( /( e abc*+d-e * /(* f abc*+d-ef ) /( abc*+d-ef*
  • 2. / ABC*+d-ef*/