SlideShare a Scribd company logo
DATA STRUCTURES
Expression Tree Conversion
Santhiya S
Assistant Professor
Department of AI
Kongu Engineering College
Expression tree conversion
infix expression to expression tree
postfix expression to expression tree
Convert the infix expression to expression tree:
infix-a*b+e/m*k-y/z
+
a*b+e/m*k y/z
-
* *
m
e/m*k
a*b
k
e/m
a
b
e
/
k
/
y z
prefix= Preorder
Postfix= postorder
Convert the postfix expression to expression tree:
+
-
*
*
m
a b
e
/
k
/
y z
Postfix: ab*em/k*+yz/-
a b * e m / k * + y z / -
a
b
*
e
m
/
k
*
+
y
z
/
-
a*b+e/m*k-y/z

More Related Content

PPTX
Binary search tree.pptx
PPTX
Queue implementation using Linked list.pptx
PPTX
Queue implementation using Array.pptx
PPTX
Stack implementation using Array.pptx
PPTX
Circular linked list.pptx
PPTX
Doubly linked list.pptx
PPTX
Singly linked list.pptx
PPTX
Linked list memory allocation and its types.pptx
Binary search tree.pptx
Queue implementation using Linked list.pptx
Queue implementation using Array.pptx
Stack implementation using Array.pptx
Circular linked list.pptx
Doubly linked list.pptx
Singly linked list.pptx
Linked list memory allocation and its types.pptx

Recently uploaded (7)

PDF
ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯSri Kshetra Champakadham Swamy Temple
PPTX
Slide Ibadah siang 29 mei 2025 jika .pptx
PPTX
Coklat Beige Ilustrasi 3 Dimensi Tugas Kelompok Presentasi.pptx
PPTX
science grade 7 quiz_Scientific Method.pptx
PDF
"ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯ""Sri Kshetra Champakadham Swamy Temple"
PPTX
Tahfidz Qur’an TIMING tampa musik bagian 2.pptx
PDF
فێرکردن و فێربوونی مۆدێرن.pdf دەروازەیەک بۆ
ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯSri Kshetra Champakadham Swamy Temple
Slide Ibadah siang 29 mei 2025 jika .pptx
Coklat Beige Ilustrasi 3 Dimensi Tugas Kelompok Presentasi.pptx
science grade 7 quiz_Scientific Method.pptx
"ಶ್ರೀ ಕ್ಷೇತ್ರ ಚಂಪಕಧಾಮ ಸ್ವಾಮಿ ದೇವಾಲಯ""Sri Kshetra Champakadham Swamy Temple"
Tahfidz Qur’an TIMING tampa musik bagian 2.pptx
فێرکردن و فێربوونی مۆدێرن.pdf دەروازەیەک بۆ
Ad
Ad

Expression tree conversion.pptx

  • 1. DATA STRUCTURES Expression Tree Conversion Santhiya S Assistant Professor Department of AI Kongu Engineering College
  • 2. Expression tree conversion infix expression to expression tree postfix expression to expression tree
  • 3. Convert the infix expression to expression tree: infix-a*b+e/m*k-y/z + a*b+e/m*k y/z - * * m e/m*k a*b k e/m a b e / k / y z prefix= Preorder Postfix= postorder
  • 4. Convert the postfix expression to expression tree: + - * * m a b e / k / y z Postfix: ab*em/k*+yz/- a b * e m / k * + y z / - a b * e m / k * + y z / - a*b+e/m*k-y/z