SlideShare a Scribd company logo
TREE Terminologies
By,
Dr. Gopika S
Department of CS
Kristu Jayanti College , Bengaluru
Trees
Tree is a finite set of vertices that has a vertex called
as root and remaining vertices are collection of
subtrees.
Dr. Gopika S , KJC , Bengaluru 2
Dr. Gopika S , KJC , Bengaluru 3
Dr. Gopika S , KJC , Bengaluru 4
5
Node Degree
• Node degree is the number of children it has
Dr. Gopika S , KJC , Bengaluru
6
Tree Degree
• Tree degree is the maximum of node degrees
tree degree = 3
Dr. Gopika S , KJC , Bengaluru
subtree
Tree Terminology
• Root: node without parent (A)
• Siblings: nodes share the same parent
• Internal node: node with at least one
child (A, B, C, F)
• External node (leaf ): node without
children (E, I, J, K, G, H, D)
• Ancestors of a node: parent,
grandparent, grand-grandparent, etc.
• Descendant of a node: child,
grandchild, grand-grandchild, etc.
• Depth of a node: number of ancestors
• Height of a tree: maximum depth of
any node (3)
• Degree of a node: the number of its
children
• Degree of a tree: the maximum
number of its node.
A
B D
C
G H
E F
I J K
Subtree: tree consisting of a
node and its descendants
Dr. Gopika S , KJC , Bengaluru 7
• Path: traversal from node to node along the edges that results in
a sequence
• Root: node at the top of the tree
• Parent: any node, except root has exactly one edge running
upward to another node. The node above it is called parent.
• Child: any node may have one or more lines running downward
to other nodes. Nodes below are children.
• Leaf: a node that has no children
• Sub tree: any node can be considered to be the root of a subtree,
which consists of its children and its children's children and so
on.
• Visiting: a node is visited when program control arrives at the
node, usually for processing.
• Traversing: to traverse a tree means to visit all the nodes in some
specified order.
• Levels: the level of a particular node refers to how many
generations the node is from the root. Root is assumed to be
level 0.
Dr. Gopika S , KJC , Bengaluru 8
• Some Terminology
– node: the item of information plus the branches to each
node.
– degree: the number of subtrees of a node
– degree of a tree: the maximum of the degree of the
nodes in the tree.
– terminal nodes (or leaf): nodes that have degree zero
– nonterminal nodes: nodes that don’t belong to terminal
nodes.
– children: the roots of the subtrees of a node X are the
children of X
– parent: X is the parent of its children.
Dr. Gopika S , KJC , Bengaluru 9
–siblings: children of the same parent are said to
be siblings.
–Ancestors of a node: all the nodes along the
path from the root to that node.
–The level of a node: defined by letting the root
be at level one. If a node is at level l, then it
children are at level l+1.
–Height (or depth): the maximum level of any
node in the tree
Dr. Gopika S , KJC , Bengaluru 10
• Example
A is the root node
B is the parent of D and E
C is the sibling of B
D and E are the children of B
D, E, F, G, I are external nodes, or leaves
A, B, C, H are internal nodes
The level of E is 3
The height (depth) of the tree is 4
The degree of node B is 2
The degree of the tree is 3
The ancestors of node I is A, C, H
The descendants of node C is F, G, H, I
A
B C
H
I
D E F G
Level
1
2
3
4
Property: (# edges) = (#nodes) - 1
Dr. Gopika S , KJC , Bengaluru 11
Thank you
Dr. Gopika S , KJC , Bengaluru 12

More Related Content

Similar to Introduction to Tree .pptx

Tree (Data Structure & Discrete Mathematics)
Tree (Data Structure & Discrete Mathematics)Tree (Data Structure & Discrete Mathematics)
Tree (Data Structure & Discrete Mathematics)
Daffodil International University
 
Terminology of tree
Terminology of treeTerminology of tree
Terminology of tree
RacksaviR
 
DSA IV Unit.pptx
DSA IV Unit.pptxDSA IV Unit.pptx
DSA IV Unit.pptx
AyeshaTakreem1
 
Module 8.1 Trees.pdf
Module 8.1 Trees.pdfModule 8.1 Trees.pdf
Module 8.1 Trees.pdf
GracesonCuyasen1
 
tree in Data Structures
tree in Data Structurestree in Data Structures
tree in Data Structures
Shankar Bishnoi
 
Discrete Mathematics - Trees
Discrete Mathematics - TreesDiscrete Mathematics - Trees
Discrete Mathematics - Trees
Marjuk Ahmed Siddiki
 
TREES34.pptx
TREES34.pptxTREES34.pptx
TREES34.pptx
BharathChalla5
 
Module - 5_Trees.pdf
Module - 5_Trees.pdfModule - 5_Trees.pdf
Module - 5_Trees.pdf
AnuradhaJadiya1
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
shameen khan
 
unit 4 for trees data structure notes it is
unit 4 for trees data structure notes it isunit 4 for trees data structure notes it is
unit 4 for trees data structure notes it is
logesswarisrinivasan
 
Tree (1).pptx
Tree (1).pptxTree (1).pptx
Tree (1).pptx
JeoJoyA
 
Tree
TreeTree
Tree
JeoJoyA
 
Tree.pptx
Tree.pptxTree.pptx
Tree.pptx
JeoJoyA
 
Chapter 8 ds
Chapter 8 dsChapter 8 ds
Chapter 8 ds
Hanif Durad
 
Trees in data structures
Trees in data structuresTrees in data structures
Trees in data structures
ASairamSairam1
 
Tree.pptx
Tree.pptxTree.pptx
Tree.pptx
worldchannel
 
Tree-In Data Structure
Tree-In Data StructureTree-In Data Structure
Tree-In Data Structure
United International University
 

Similar to Introduction to Tree .pptx (20)

Tree (Data Structure & Discrete Mathematics)
Tree (Data Structure & Discrete Mathematics)Tree (Data Structure & Discrete Mathematics)
Tree (Data Structure & Discrete Mathematics)
 
Terminology of tree
Terminology of treeTerminology of tree
Terminology of tree
 
DSA IV Unit.pptx
DSA IV Unit.pptxDSA IV Unit.pptx
DSA IV Unit.pptx
 
Module 8.1 Trees.pdf
Module 8.1 Trees.pdfModule 8.1 Trees.pdf
Module 8.1 Trees.pdf
 
Tree of Data Structure
Tree of Data StructureTree of Data Structure
Tree of Data Structure
 
tree in Data Structures
tree in Data Structurestree in Data Structures
tree in Data Structures
 
Discrete Mathematics - Trees
Discrete Mathematics - TreesDiscrete Mathematics - Trees
Discrete Mathematics - Trees
 
TREES34.pptx
TREES34.pptxTREES34.pptx
TREES34.pptx
 
Module - 5_Trees.pdf
Module - 5_Trees.pdfModule - 5_Trees.pdf
Module - 5_Trees.pdf
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
 
unit 4 for trees data structure notes it is
unit 4 for trees data structure notes it isunit 4 for trees data structure notes it is
unit 4 for trees data structure notes it is
 
Data structures 3
Data structures 3Data structures 3
Data structures 3
 
Tree (1).pptx
Tree (1).pptxTree (1).pptx
Tree (1).pptx
 
Tree
TreeTree
Tree
 
Tree.pptx
Tree.pptxTree.pptx
Tree.pptx
 
Chapter 8 ds
Chapter 8 dsChapter 8 ds
Chapter 8 ds
 
Trees in data structures
Trees in data structuresTrees in data structures
Trees in data structures
 
Trees krw
Trees krwTrees krw
Trees krw
 
Tree.pptx
Tree.pptxTree.pptx
Tree.pptx
 
Tree-In Data Structure
Tree-In Data StructureTree-In Data Structure
Tree-In Data Structure
 

More from GopikaS12

Deadlock _Classic problems.pptx
Deadlock _Classic problems.pptxDeadlock _Classic problems.pptx
Deadlock _Classic problems.pptx
GopikaS12
 
C Programming language - introduction
C Programming  language - introduction  C Programming  language - introduction
C Programming language - introduction
GopikaS12
 
C formatted and unformatted input and output constructs
C  formatted and unformatted input and output constructsC  formatted and unformatted input and output constructs
C formatted and unformatted input and output constructs
GopikaS12
 
Heap creation from elements - Step by step Approach
Heap creation  from elements - Step by step Approach Heap creation  from elements - Step by step Approach
Heap creation from elements - Step by step Approach
GopikaS12
 
Data Structures: Stack Operations
Data Structures:    Stack OperationsData Structures:    Stack Operations
Data Structures: Stack Operations
GopikaS12
 
Net content in computer architecture
Net content in computer  architectureNet content in computer  architecture
Net content in computer architecture
GopikaS12
 
It unit 1
It   unit 1It   unit 1
It unit 1
GopikaS12
 

More from GopikaS12 (7)

Deadlock _Classic problems.pptx
Deadlock _Classic problems.pptxDeadlock _Classic problems.pptx
Deadlock _Classic problems.pptx
 
C Programming language - introduction
C Programming  language - introduction  C Programming  language - introduction
C Programming language - introduction
 
C formatted and unformatted input and output constructs
C  formatted and unformatted input and output constructsC  formatted and unformatted input and output constructs
C formatted and unformatted input and output constructs
 
Heap creation from elements - Step by step Approach
Heap creation  from elements - Step by step Approach Heap creation  from elements - Step by step Approach
Heap creation from elements - Step by step Approach
 
Data Structures: Stack Operations
Data Structures:    Stack OperationsData Structures:    Stack Operations
Data Structures: Stack Operations
 
Net content in computer architecture
Net content in computer  architectureNet content in computer  architecture
Net content in computer architecture
 
It unit 1
It   unit 1It   unit 1
It unit 1
 

Recently uploaded

Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
Divya Somashekar
 
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
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
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
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
ShahidSultan24
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
MLILAB
 

Recently uploaded (20)

Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
block diagram and signal flow graph representation
block diagram and signal flow graph representationblock diagram and signal flow graph representation
block diagram and signal flow graph representation
 
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.
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
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
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
addressing modes in computer architecture
addressing modes  in computer architectureaddressing modes  in computer architecture
addressing modes in computer architecture
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
H.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdfH.Seo,  ICLR 2024, MLILAB,  KAIST AI.pdf
H.Seo, ICLR 2024, MLILAB, KAIST AI.pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang,  ICLR 2024, MLILAB, KAIST AI.pdfJ.Yang,  ICLR 2024, MLILAB, KAIST AI.pdf
J.Yang, ICLR 2024, MLILAB, KAIST AI.pdf
 

Introduction to Tree .pptx

  • 1. TREE Terminologies By, Dr. Gopika S Department of CS Kristu Jayanti College , Bengaluru
  • 2. Trees Tree is a finite set of vertices that has a vertex called as root and remaining vertices are collection of subtrees. Dr. Gopika S , KJC , Bengaluru 2
  • 3. Dr. Gopika S , KJC , Bengaluru 3
  • 4. Dr. Gopika S , KJC , Bengaluru 4
  • 5. 5 Node Degree • Node degree is the number of children it has Dr. Gopika S , KJC , Bengaluru
  • 6. 6 Tree Degree • Tree degree is the maximum of node degrees tree degree = 3 Dr. Gopika S , KJC , Bengaluru
  • 7. subtree Tree Terminology • Root: node without parent (A) • Siblings: nodes share the same parent • Internal node: node with at least one child (A, B, C, F) • External node (leaf ): node without children (E, I, J, K, G, H, D) • Ancestors of a node: parent, grandparent, grand-grandparent, etc. • Descendant of a node: child, grandchild, grand-grandchild, etc. • Depth of a node: number of ancestors • Height of a tree: maximum depth of any node (3) • Degree of a node: the number of its children • Degree of a tree: the maximum number of its node. A B D C G H E F I J K Subtree: tree consisting of a node and its descendants Dr. Gopika S , KJC , Bengaluru 7
  • 8. • Path: traversal from node to node along the edges that results in a sequence • Root: node at the top of the tree • Parent: any node, except root has exactly one edge running upward to another node. The node above it is called parent. • Child: any node may have one or more lines running downward to other nodes. Nodes below are children. • Leaf: a node that has no children • Sub tree: any node can be considered to be the root of a subtree, which consists of its children and its children's children and so on. • Visiting: a node is visited when program control arrives at the node, usually for processing. • Traversing: to traverse a tree means to visit all the nodes in some specified order. • Levels: the level of a particular node refers to how many generations the node is from the root. Root is assumed to be level 0. Dr. Gopika S , KJC , Bengaluru 8
  • 9. • Some Terminology – node: the item of information plus the branches to each node. – degree: the number of subtrees of a node – degree of a tree: the maximum of the degree of the nodes in the tree. – terminal nodes (or leaf): nodes that have degree zero – nonterminal nodes: nodes that don’t belong to terminal nodes. – children: the roots of the subtrees of a node X are the children of X – parent: X is the parent of its children. Dr. Gopika S , KJC , Bengaluru 9
  • 10. –siblings: children of the same parent are said to be siblings. –Ancestors of a node: all the nodes along the path from the root to that node. –The level of a node: defined by letting the root be at level one. If a node is at level l, then it children are at level l+1. –Height (or depth): the maximum level of any node in the tree Dr. Gopika S , KJC , Bengaluru 10
  • 11. • Example A is the root node B is the parent of D and E C is the sibling of B D and E are the children of B D, E, F, G, I are external nodes, or leaves A, B, C, H are internal nodes The level of E is 3 The height (depth) of the tree is 4 The degree of node B is 2 The degree of the tree is 3 The ancestors of node I is A, C, H The descendants of node C is F, G, H, I A B C H I D E F G Level 1 2 3 4 Property: (# edges) = (#nodes) - 1 Dr. Gopika S , KJC , Bengaluru 11
  • 12. Thank you Dr. Gopika S , KJC , Bengaluru 12