Professional Documents
Culture Documents
Tree Structure
Tree Structure
2022-2023
BAYAN O. MOHAMMED
Introduction to Tree
2
2
Overview
Tree data structure
Binary tree
Binary search trees
* To design and implement a binary search tree .
* To insert an element to a binary search tree .
3
3
Introduction to Tree
➢ Tree is a non-linear data structure.
➢ Data in a tree is stored in hierarchy.
Example of tree application:
• Represent algebraic formulas
• Store data in hierarchy form. Ex: algebraic formulas : (1+2)*3
organization chart
• Artificial intelligence – information is
accessed based on certain decision which is
stored in a tree.
organization chart
4
Definitions
5
5
Tree Terminology
➢Any two vertices must have one and only one
path between them else its not a tree.
6
Tree Terminology
7
Tree Terminology
8
8
Tree Terminology
9
Tree Terminology
10
Tree Terminology
11
Tree Terminology
12
Tree Terminology
13
Example
14
Example
3
15
Definitions: node relationships
16
16
Example
18
Algorithm for computing the Height
19
Thank you for your attendance