SlideShare a Scribd company logo
1 of 12
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 (20)

Terminology of tree
Terminology of treeTerminology of tree
Terminology of tree
 
Graph and tree
Graph and treeGraph and tree
Graph and tree
 
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
 
UNIT-4 TREES.ppt
UNIT-4 TREES.pptUNIT-4 TREES.ppt
UNIT-4 TREES.ppt
 
Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
 

More from GopikaS12

Deadlock _Classic problems.pptx
Deadlock _Classic problems.pptxDeadlock _Classic problems.pptx
Deadlock _Classic problems.pptxGopikaS12
 
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 constructsGopikaS12
 
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 OperationsGopikaS12
 
Net content in computer architecture
Net content in computer  architectureNet content in computer  architecture
Net content in computer architectureGopikaS12
 

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

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 

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