DS-Lec11 (Introduction To Tree Data Structures)
DS-Lec11 (Introduction To Tree Data Structures)
Content
By
Zainab Malik
3 4
• Hierarchical Data:
Army Navy Air Force
• Data that has ancestor-descendant, superior-subordinate, whole-
part or similar relationship among its elements. Representation using Tree Data Structure
1
3/2/2023
5 6
(a) (b)
(c)
7 8
2
3/2/2023
9 10
11 12
3
3/2/2023
13 14
• Left Child: 2𝐾
• Right Child: 2𝐾 + 1
• Parent: 𝐾/2
• Height (𝑯𝒏 )=Depth(𝑫𝒏)= log 𝑛 + 1
• = log (12) + 1 = 3.58 + 1 = 4
15 16
(a) (b)
4
3/2/2023
17
Thank You