SlideShare a Scribd company logo
Sanjivani Rural Education Society’s
Sanjivani College of Engineering, Kopargaon-423 603
(An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune)
NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified
Department of Computer Engineering
(NBA Accredited)
Prof. V.N.Nirgude
Assistant Professor
E-mail : nirgudevikascomp@sanjivani.org.in
Contact No: 9975240215
Subject- Data Structures-II(CO214)
Unit-II Tree
Contents
• Analysis of Algorithms: Recurrences, Master Method
• Tree: Introduction, Tree Terminologies, Binary Tree, Representation, Types of
Binary Tree, Binary Tree Traversals, Binary Search Tree, operations on BST,
Threaded binary tree, Applications – Expression Tree, Huffman Encoding.
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 2
Tree Introduction
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 3
• It is a Non-linear Data structure
• Trees are mainly used to represent data containing the hierarchical
relationship between elements, example: records, family trees, and
table of contents.
• A tree may be defined as a finite set 'T' of one or more nodes such
that
• There is a node designated as the root of the tree
• The other nodes are divided into n>=0 disjoint sets T1, T2, T3,
T4 …. Tn are called the sub trees or children of the root.
• Example of Tree- Book
Index
• DS-II
o Tree
 Basics
 Binary tree
o Graph
 Basics
 Representation
• List
• Matrix
 Algo.
o Hashing
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4
DS-II
Tree
Graph
Hashi
ng
Basics
Binary
tree
Represe
ntation
Basics
Algo
List
Matr
ix
Definition : if T is not empty,
• T is a special tree which has the root that has no parent
• Each node v of T different than the root has a unique parent node w; each node
with parent w is a child of w
Terminologies
• Root: In a tree data structure, the first node is called as Root Node.
• Every tree must have a root node. We can say that the root node is the origin of the tree data structure.
In any tree, there must be only one root node. We never have multiple root nodes in a tree.
• Node: A Node is a information of any type. Node often represented as letter, string or number.
Information of each node is inside circle. Line joining information is called as branches or edges
• Siblings: Two nodes that have same parent are called siblings
• Internal nodes : nodes that have children
• External nodes or leaves : the node which does not have a child is called as LEAF Node. Leaf nodes
also called as External or terminal node.
• Ancestors: ancestors of node are all the nodes along the path from root to that
node. Ancestor of K is A ,C, G
• Forest: A forest is a set of n>=0 disjoint trees. if we remove root of tree we get a
forest. if we remove A , then we get forest with 2 trees.
• Descendants: The list of all node reachable from that node.
• E.g.Descendant of node C are G,H,K
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 7
• Degree of node: The total number of children of a node is called as DEGREE of that Node.
• Degree of tree: The highest degree of a node among all the nodes in a tree is called as 'Degree of Tree‘
• Level: In a tree data structure, the root node is said to be at Level 0 and the children of root node are at
Level 1 and the children of the nodes which are at Level 1 will be at Level 2 and so on... In simple
words, in a tree each step from top to bottom is called as a Level and the Level count starts with '0' and
incremented by one at each level (Step)
• Height: The total number of edges from leaf node to a particular node in the longest path is called
as HEIGHT of that Node. In a tree, height of the root node is said to be height of the tree. In a
tree, height of all leaf nodes is '0'.
• Depth: In a tree data structure, the total number of edges from root node to a particular node is called
as DEPTH of that Node. In a tree, the total number of edges from root node to a leaf node in the
longest path is said to be Depth of the tree. In simple words, the highest depth of any leaf node in a
tree is said to be depth of that tree. In a tree, depth of the root node is '0'.
Path: The sequence of Nodes and Edges from one node to another node is called as PATH between that
two Nodes. Length of a Path is total number of nodes in that path. In below example the path A - B - E
- J has length 4.
Tree Representation
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 13
A
B C
D F
E G
Data
FC NS
A
X
B
F
X
E
X
D
X
C
X
G
X
Node
Representation
Excercise
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 14
Exercise
• Degree of node B
• Height of tree
• Height of node B
• Which nodes are leaves
• parent of node C
• Ancestors of node E
• Descendent of node E
• Right siblings of node D and E
• Different path of legnth 3
DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 15

More Related Content

Similar to Tree-introduction ,Definition, Types of BT

Tree.pptx
Tree.pptxTree.pptx
Tree.pptx
worldchannel
 
Tree Introduction.pptx
Tree Introduction.pptxTree Introduction.pptx
Tree Introduction.pptx
RahulAI
 
Data structure using c module 2
Data structure using c module 2Data structure using c module 2
Data structure using c module 2
smruti sarangi
 
Lecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptxLecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptx
fizzaahmed9
 
NON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptxNON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptx
Rajitha Reddy Alugati
 
Final tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentationFinal tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentation
nakulvarshney371
 
tree in Data Structures
tree in Data Structurestree in Data Structures
tree in Data Structures
Shankar Bishnoi
 
Module 8.1 Trees.pdf
Module 8.1 Trees.pdfModule 8.1 Trees.pdf
Module 8.1 Trees.pdf
GracesonCuyasen1
 
Data structure tree- advance
Data structure tree- advanceData structure tree- advance
Data structure tree- advance
MD. MARUFUZZAMAN .
 
TERMINOLOGIES OF TREE, TYPES OF TREE.pptx
TERMINOLOGIES OF TREE, TYPES OF TREE.pptxTERMINOLOGIES OF TREE, TYPES OF TREE.pptx
TERMINOLOGIES OF TREE, TYPES OF TREE.pptx
KALPANAC20
 
Trees-Terminology.pptx
Trees-Terminology.pptxTrees-Terminology.pptx
Trees-Terminology.pptx
HarshanaReddyGillala
 
Trees in data structures
Trees in data structuresTrees in data structures
Trees in data structures
ASairamSairam1
 
Lecture 5 tree.pptx
Lecture 5 tree.pptxLecture 5 tree.pptx
Lecture 5 tree.pptx
Abirami A
 
Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
Dabbal Singh Mahara
 
Unit 5 Tree.pptx
Unit 5 Tree.pptxUnit 5 Tree.pptx
Unit 5 Tree.pptx
SurajSharma266169
 
Trees
TreesTrees
Introduction to Tree .pptx
Introduction to Tree .pptxIntroduction to Tree .pptx
Introduction to Tree .pptx
GopikaS12
 
Data structure tree - intermediate
Data structure tree - intermediateData structure tree - intermediate
Data structure tree - intermediate
MD. MARUFUZZAMAN .
 
Dsc++ unit 3 notes
Dsc++ unit 3 notesDsc++ unit 3 notes
Dsc++ unit 3 notes
Guru Nanak Institute Of Tech
 
Search tree,Tree and binary tree and heap tree
Search tree,Tree  and binary tree and heap treeSearch tree,Tree  and binary tree and heap tree
Search tree,Tree and binary tree and heap tree
zia eagle
 

Similar to Tree-introduction ,Definition, Types of BT (20)

Tree.pptx
Tree.pptxTree.pptx
Tree.pptx
 
Tree Introduction.pptx
Tree Introduction.pptxTree Introduction.pptx
Tree Introduction.pptx
 
Data structure using c module 2
Data structure using c module 2Data structure using c module 2
Data structure using c module 2
 
Lecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptxLecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptx
 
NON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptxNON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptx
 
Final tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentationFinal tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentation
 
tree in Data Structures
tree in Data Structurestree in Data Structures
tree in Data Structures
 
Module 8.1 Trees.pdf
Module 8.1 Trees.pdfModule 8.1 Trees.pdf
Module 8.1 Trees.pdf
 
Data structure tree- advance
Data structure tree- advanceData structure tree- advance
Data structure tree- advance
 
TERMINOLOGIES OF TREE, TYPES OF TREE.pptx
TERMINOLOGIES OF TREE, TYPES OF TREE.pptxTERMINOLOGIES OF TREE, TYPES OF TREE.pptx
TERMINOLOGIES OF TREE, TYPES OF TREE.pptx
 
Trees-Terminology.pptx
Trees-Terminology.pptxTrees-Terminology.pptx
Trees-Terminology.pptx
 
Trees in data structures
Trees in data structuresTrees in data structures
Trees in data structures
 
Lecture 5 tree.pptx
Lecture 5 tree.pptxLecture 5 tree.pptx
Lecture 5 tree.pptx
 
Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
 
Unit 5 Tree.pptx
Unit 5 Tree.pptxUnit 5 Tree.pptx
Unit 5 Tree.pptx
 
Trees
TreesTrees
Trees
 
Introduction to Tree .pptx
Introduction to Tree .pptxIntroduction to Tree .pptx
Introduction to Tree .pptx
 
Data structure tree - intermediate
Data structure tree - intermediateData structure tree - intermediate
Data structure tree - intermediate
 
Dsc++ unit 3 notes
Dsc++ unit 3 notesDsc++ unit 3 notes
Dsc++ unit 3 notes
 
Search tree,Tree and binary tree and heap tree
Search tree,Tree  and binary tree and heap treeSearch tree,Tree  and binary tree and heap tree
Search tree,Tree and binary tree and heap tree
 

Recently uploaded

Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
AbrahamGadissa
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
A case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfA case study of cinema management system project report..pdf
A case study of cinema management system project report..pdf
Kamal Acharya
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
MuhammadTufail242431
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Antenna efficency lecture course chapter 3.pdf
Antenna  efficency lecture course chapter 3.pdfAntenna  efficency lecture course chapter 3.pdf
Antenna efficency lecture course chapter 3.pdf
AbrahamGadissa
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
Kamal Acharya
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
Kamal Acharya
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
fxintegritypublishin
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
jeevanprasad8
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
Kamal Acharya
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
Amil baba
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
NurvisNavarroSanchez
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Dr.Costas Sachpazis
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 

Recently uploaded (20)

Digital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdfDigital Signal Processing Lecture notes n.pdf
Digital Signal Processing Lecture notes n.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
A case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfA case study of cinema management system project report..pdf
A case study of cinema management system project report..pdf
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Standard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - NeometrixStandard Reomte Control Interface - Neometrix
Standard Reomte Control Interface - Neometrix
 
Antenna efficency lecture course chapter 3.pdf
Antenna  efficency lecture course chapter 3.pdfAntenna  efficency lecture course chapter 3.pdf
Antenna efficency lecture course chapter 3.pdf
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
Hall booking system project report .pdf
Hall booking system project report  .pdfHall booking system project report  .pdf
Hall booking system project report .pdf
 
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdfHybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdf
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdfA CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
A CASE STUDY ON ONLINE TICKET BOOKING SYSTEM PROJECT.pdf
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdfDanfoss NeoCharge Technology -A Revolution in 2024.pdf
Danfoss NeoCharge Technology -A Revolution in 2024.pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 

Tree-introduction ,Definition, Types of BT

  • 1. Sanjivani Rural Education Society’s Sanjivani College of Engineering, Kopargaon-423 603 (An Autonomous Institute, Affiliated to Savitribai Phule Pune University, Pune) NACC ‘A’ Grade Accredited, ISO 9001:2015 Certified Department of Computer Engineering (NBA Accredited) Prof. V.N.Nirgude Assistant Professor E-mail : nirgudevikascomp@sanjivani.org.in Contact No: 9975240215 Subject- Data Structures-II(CO214) Unit-II Tree
  • 2. Contents • Analysis of Algorithms: Recurrences, Master Method • Tree: Introduction, Tree Terminologies, Binary Tree, Representation, Types of Binary Tree, Binary Tree Traversals, Binary Search Tree, operations on BST, Threaded binary tree, Applications – Expression Tree, Huffman Encoding. DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 2
  • 3. Tree Introduction DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 3 • It is a Non-linear Data structure • Trees are mainly used to represent data containing the hierarchical relationship between elements, example: records, family trees, and table of contents. • A tree may be defined as a finite set 'T' of one or more nodes such that • There is a node designated as the root of the tree • The other nodes are divided into n>=0 disjoint sets T1, T2, T3, T4 …. Tn are called the sub trees or children of the root.
  • 4. • Example of Tree- Book Index • DS-II o Tree  Basics  Binary tree o Graph  Basics  Representation • List • Matrix  Algo. o Hashing DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 4 DS-II Tree Graph Hashi ng Basics Binary tree Represe ntation Basics Algo List Matr ix
  • 5. Definition : if T is not empty, • T is a special tree which has the root that has no parent • Each node v of T different than the root has a unique parent node w; each node with parent w is a child of w
  • 6. Terminologies • Root: In a tree data structure, the first node is called as Root Node. • Every tree must have a root node. We can say that the root node is the origin of the tree data structure. In any tree, there must be only one root node. We never have multiple root nodes in a tree. • Node: A Node is a information of any type. Node often represented as letter, string or number. Information of each node is inside circle. Line joining information is called as branches or edges • Siblings: Two nodes that have same parent are called siblings • Internal nodes : nodes that have children • External nodes or leaves : the node which does not have a child is called as LEAF Node. Leaf nodes also called as External or terminal node.
  • 7. • Ancestors: ancestors of node are all the nodes along the path from root to that node. Ancestor of K is A ,C, G • Forest: A forest is a set of n>=0 disjoint trees. if we remove root of tree we get a forest. if we remove A , then we get forest with 2 trees. • Descendants: The list of all node reachable from that node. • E.g.Descendant of node C are G,H,K DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 7
  • 8.
  • 9. • Degree of node: The total number of children of a node is called as DEGREE of that Node. • Degree of tree: The highest degree of a node among all the nodes in a tree is called as 'Degree of Tree‘ • Level: In a tree data structure, the root node is said to be at Level 0 and the children of root node are at Level 1 and the children of the nodes which are at Level 1 will be at Level 2 and so on... In simple words, in a tree each step from top to bottom is called as a Level and the Level count starts with '0' and incremented by one at each level (Step) • Height: The total number of edges from leaf node to a particular node in the longest path is called as HEIGHT of that Node. In a tree, height of the root node is said to be height of the tree. In a tree, height of all leaf nodes is '0'.
  • 10.
  • 11. • Depth: In a tree data structure, the total number of edges from root node to a particular node is called as DEPTH of that Node. In a tree, the total number of edges from root node to a leaf node in the longest path is said to be Depth of the tree. In simple words, the highest depth of any leaf node in a tree is said to be depth of that tree. In a tree, depth of the root node is '0'.
  • 12. Path: The sequence of Nodes and Edges from one node to another node is called as PATH between that two Nodes. Length of a Path is total number of nodes in that path. In below example the path A - B - E - J has length 4.
  • 13. Tree Representation DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 13 A B C D F E G Data FC NS A X B F X E X D X C X G X Node Representation
  • 14. Excercise DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 14
  • 15. Exercise • Degree of node B • Height of tree • Height of node B • Which nodes are leaves • parent of node C • Ancestors of node E • Descendent of node E • Right siblings of node D and E • Different path of legnth 3 DEPARTMENT OF COMPUTER ENGINEERING, Sanjivani COE, Kopargaon 15