CS DataStructure-Lecture 7 - Introduction To Tree
CS DataStructure-Lecture 7 - Introduction To Tree
41 17
6
17 41 9
81
9 6 81
17 17
41
6 41 9
9
81 6 81
6 17
41
81 41 9
9
17 6 81
– In-order:
15 9
15 48 27 42 86 5 12 9 3 39
27 86 3
– Post-order:
48 27 15 5 12 86 39 3 9 42 48 12 39
5
Example: Expression Trees
• It is a binary tree contains an arithmetic
expression with some operators and operands.
++
*
a
a b
a++
a* b
Example: Expression Trees
References
• Introduction to Tree - Data Structure and Algorithm Tutorials –
GeeksforGeeks
• Difference between Full and Complete Binary Tree – GeeksforGeeks
• Tree Traversals (Inorder, Preorder and Postorder) - GeeksforGeeks