SlideShare a Scribd company logo
1 of 122
TREES
Trees - Introduction
 All previous data organizations we've studied
are linear—each element can have only one
predecessor and successor
 Accessing all elements in a linear sequence is
O(n)
 Trees are nonlinear and hierarchical
 Tree nodes can have multiple successors (but
only one predecessor)
Trees - Introduction (cont.)
 Trees can represent hierarchical organizations
of information:
 class hierarchy
 disk directory and subdirectories
 family tree
 Trees are recursive data structures because
they can be defined recursively
 Many methods to process trees are written
recursively
Tree Terminology and
Applications
Tree Terminology
dog
cat wolf
canine
A tree consists of a collection of elements or
nodes, with each node linked to its successors
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or
nodes, with each node linked to its successors
The node at the top
of a tree is called its
root
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or
nodes, with each node linked to its successors
The links from a
node to its
successors are
called branches
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or
nodes, with each node linked to its successors
The successors of a
node are called its
children
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or
nodes, with each node linked to its successors
The predecessor of
a node is called its
parent
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or
nodes, with each node linked to its successors
Each node in a tree
has exactly one parent
except for the root
node, which has no
parent
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or
nodes, with each node linked to its successors
Nodes that have the
same parent are
siblings
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
A node that has no
children is called a
leaf node
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
A node that has no
children is called a
leaf node
Leaf nodes also are
known as
external nodes,
and nonleaf nodes
are known as
internal nodes
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
A generalization of the parent-child
relationship is the
ancestor-descendant relationship
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
dog is the parent
of cat in this tree
A generalization of the parent-child
relationship is the
ancestor-descendant relationship
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
cat is the parent
of canine in this
tree
A generalization of the parent-child
relationship is the
ancestor-descendant relationship
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
canine is a
descendant of cat
in this tree
A generalization of the parent-child
relationship is the
ancestor-descendant relationship
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
dog is an
ancestor of
canine in this tree
A generalization of the parent-child
relationship is the
ancestor-descendant relationship
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
A subtree of a node
is a tree whose root
is a child of that
node
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
A subtree of a node
is a tree whose root
is a child of that
node
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
A subtree of a node
is a tree whose root
is a child of that
node
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
The level of a node
is determined by its
distance from the
root
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
The level of a node
is its distance from
the root plus 1
Level 1
Level 2
Level 3
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
The level of a node
is defined
recursively
Level 1
Level 2
Level 3
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
The level of a node
is defined
recursively
Level 1
Level 2
Level 3
• If node n is the root of tree T, its level is 1
• If node n is not the root of tree T, its level is
1 + the level of its parent
Level 0
Level 1
Level 2
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
The height of a
node is the
number of edges
from the node to
the deepest leaf
(ie. the longest
path from the
node to a leaf
node).
Tree Terminology (cont.)
dog
cat wolf
canine
A tree consists of a collection of elements or nodes,
with each node linked to its successors
The height of
this tree is 2
The height of a
node is the
number of edges
from the node to
the deepest leaf
(ie. the longest
path from the
node to a leaf
node).
Binary Trees
 A tree whose elements have at most 2 children
is called a binary tree.
 A set of nodes T is a binary tree if either of the
following is true
 T is empty
 Its root node has two subtrees, TL and TR, such
that TL and TR are binary trees
(TL = left subtree; TR = right subtree)
Expression Tree
 Each node contains an
operator or an operand
 Operands are stored in
leaf nodes
 Parentheses are not stored
in the tree because the tree structure dictates
the order of operand evaluation
 Operators in nodes at higher tree levels are
evaluated after operators in nodes at lower
tree levels
(x + y) * ((a + b) / c)
Huffman Tree
 A Huffman tree represents Huffman codes for
characters that might appear in a text file
 As opposed to ASCII or Unicode, Huffman
code uses different numbers of bits to encode
letters; more common characters use fewer
bits
 Many programs that compress files use
Huffman codes
Huffman Tree (cont.)
To form a code, traverse the tree from the
root to the chosen character, appending 0
if you branch left, and 1 if you branch
right.
Huffman Tree (cont.)
Examples:
d : 10110
e : 010
Binary Search Tree
 Binary search trees
 All elements in the left subtree
precede those in the right subtree
 A formal definition:
A set of nodes T is a binary
search tree if either of the following is true:
 T is empty
 If T is not empty, its root node has two subtrees, TL
and TR, such that TL and TR are binary search trees
and the value in the root node of T is greater than all
values in TL and is less than all values in TR
Binary Search Tree (cont.)
 When searching a BST, each probe has the
potential to eliminate half the elements in the
tree, so searching can be O(log n)
 In the worst case, searching is O(n)
Recursive Algorithm for
Searching a Binary Tree
1. if the tree is empty
2. return null (target is not found)
else if the target matches the root node's data
3. return the data stored at the root node
else if the target is less than the root node's data
4. return the result of searching the left subtree of the
root
else
5. return the result of searching the right subtree of the
root
Full, Perfect, and Complete
Binary Trees
 A full binary tree is a
binary tree where all
nodes have either 2
children or 0 children
(the leaf nodes)
7
10
1
12
9
3
0
5
2 11
6
4
13
Full, Perfect, and Complete
Binary Trees (cont.)
 A perfect binary tree is
a full binary tree of
height n with exactly
2n+1 – 1 nodes
 In this case, n = 2 and
2n+1 – 1 = 7
3
1
4
2
0
5
6
Full, Perfect, and Complete
Binary Trees (cont.)
 A complete binary tree
is a perfect binary tree
through level n - 1 with
some extra leaf nodes
at level n (the tree
height), all toward the
left.
 A Binary Tree is a
complete Binary Tree if
all the levels are
completely filled except
possibly the last level
and the last level has all
keys as left as possible
3
1
4
2
0
5
Section 6.2
Tree Traversals
Tree Traversals
 Often we want to determine the nodes of a
tree and their relationship
 We can do this by walking through the tree in a
prescribed order and visiting the nodes as they
are encountered
 This process is called tree traversal
 Three common kinds of tree traversal
 Inorder
 Preorder
 Postorder
Tree Traversals (cont.)
 Preorder: visit root node, traverse TL, traverse
TR
 Inorder: traverse TL, visit root node, traverse TR
 Postorder: traverse TL, traverse TR, visit root
node
Visualizing Tree Traversals
 You can visualize a tree
traversal by imagining a
mouse that walks along the
edge of the tree
 If the mouse always keeps
the tree to the left, it will
trace a route known as the
Euler tour
 The Euler tour is the path
traced in blue in the figure
on the right
Visualizing Tree Traversals
(cont.)
 If we record a node as
the mouse visits each
node before traversing its
subtrees (shown by the
downward pointing
arrows) we get a preorder
traversal
 The sequence in this
example is
a b d g e h c f i j
Visualizing Tree Traversals
(cont.)
 If we record a node as
the mouse returns from
traversing its left subtree
(shown by horizontal
black arrows in the figure)
we get an inorder
traversal
 The sequence is
d g b h e a i f j c
Visualizing Tree Traversals
(cont.)
 If we record each node
as the mouse last
encounters it, we get a
postorder traversal
(shown by the upward
pointing arrows)
 The sequence is
g d h e b i j f c a
Traversals of Binary Search
Trees and Expression Trees
 An inorder traversal of a
binary search tree results
in the nodes being visited
in sequence by
increasing data value
canine, cat, dog, wolf
dog
cat wolf
canine
Traversals of Binary Search Trees
and Expression Trees (cont.)
 An inorder traversal of an
expression tree results in the
sequence
x + y * a + b / c
 If we insert parentheses
where they belong, we get
the infix form:
(x + y) * ((a + b) / c)
*
/
+
c
+
y
x
b
a
Traversals of Binary Search Trees
and Expression Trees (cont.)
 A postorder traversal of an
expression tree results in the
sequence
x y + a b + c / *
 This is the postfix or reverse
polish form of the expression
 Operators follow operands
*
/
+
c
+
y
x
b
a
Traversals of Binary Search Trees
and Expression Trees (cont.)
 A preorder traversal of an
expression tree results in the
sequence
* + x y / + a b c
 This is the prefix or forward
polish form of the expression
 Operators precede operands
*
/
+
c
+
y
x
b
a
BINARY SEARCH TREE
A running demonstration of binary search data structure and
algorithms
Insert
First value is the 'Root' of the tree.
87
Insert
87
Since 50 is Less than 87, we move to the left sub-tree
**Since no sub-tree, 50 is now added as the left leaf**
50
Insert
87
50
Since 27 is Less than 87, we move to the left sub-tree
Since 27 is Less than 50, we move to the left sub-tree
**Since no sub-tree, 27 is now added as the left leaf**
27
Insert
87
50
27
Since 111 is Greater than 87, we move to the right sub-tree
**Since no sub-tree, 111 is now added as the right leaf**
111
Insert
87
50
27
111
Since 99 is Greater than 87, we move to the right sub-tree
Since 99 is Less than 111, we move to the left sub-tree
**Since no sub-tree, 99 is now added as the left leaf**
99
Insert
87
50
27
111
99
Since 42 is Less than 87, we move to the left sub-tree
Since 42 is Less than 50, we move to the left sub-tree
Since 42 is Greater than 27, we move to the right sub-tree
**Since no sub-tree, 42 is now added as the right leaf**
42
Insert
87
50
27
111
99
42
Since 90 is Greater than 87, we move to the right sub-tree
Since 90 is Less than 111, we move to the left sub-tree
Since 90 is Less than 99, we move to the left sub-tree
**Since no sub-tree, 90 is now added as the left leaf**
90
Insert
87
50
27
111
99
42 90
Since 105 is Greater than 87, we move to the right sub-tree
Since 105 is Less than 111, we move to the left sub-tree
Since 105 is Greater than 99, we move to the right sub-tree
**Since no sub-tree, 105 is now added as the right leaf**
105
Insert
87
50
27
111
99
42 90 105
Since 58 is Less than 87, we move to the left sub-tree
Since 58 is Greater than 50, we move to the right sub-tree
**Since no sub-tree, 58 is now added as the right leaf**
58
Insert
87
50
27
111
99
42 90 105
58
Since 32 is Less than 87, we move to the left sub-tree
Since 32 is Less than 50, we move to the left sub-tree
Since 32 is Greater than 27, we move to the right sub-tree
Since 32 is Less than 42, we move to the left sub-tree
**Since no sub-tree, 32 is now added as the left leaf**
32
Insert
87
50
27
111
99
42 90 105
58
32
Since 68 is Less than 87, we move to the left sub-tree
Since 68 is Greater than 50, we move to the right sub-tree
Since 68 is Greater than 58, we move to the right sub-tree
**Since no sub-tree, 68 is now added as the right leaf**
68
Insert
87
50
27
111
99
42 90 105
58
32
68
Since 43 is Less than 87, we move to the left sub-tree
Since 43 is Less than 50, we move to the left sub-tree
Since 43 is Greater than 27, we move to the right sub-tree
Since 43 is Greater than 42, we move to the right sub-tree
**Since no sub-tree, 43 is now added as the right leaf**
43
Insert
87
50
27
111
99
42 90 105
58
32
68
43
Since 60 is Less than 87, we move to the left sub-tree
Since 60 is Greater than 50, we move to the right sub-tree
Since 60 is Greater than 58, we move to the right sub-tree
Since 60 is Less than 68, we move to the left sub-tree
**Since no sub-tree, 60 is now added as the left leaf**
60
Insert
87
50
27
111
99
42 90 105
58
32
68
43 60
Since 70 is Less than 87, we move to the left sub-tree
Since 70 is Greater than 50, we move to the right sub-tree
Since 70 is Greater than 58, we move to the right sub-tree
Since 70 is Greater than 68, we move to the right sub-tree
**Since no sub-tree, 70 is now added as the right leaf**
70
Insert
87
50
27
111
99
42 90 105
58
32
68
43 60 70
Since 51 is Less than 87, we move to the left sub-tree
Since 51 is Greater than 50, we move to the right sub-tree
Since 51 is Less than 58, we move to the left sub-tree
**Since no sub-tree, 51 is now added as the left leaf**
51
Insert
87
50
27
111
99
42 90 105
58
32
68
43 60 70
51
Since 1 is Less than 87, we move to the left sub-tree
Since 1 is Less than 50, we move to the left sub-tree
Since 1 is Less than 27, we move to the left sub-tree
**Since no sub-tree, 1 is now added as the left leaf**
1
Insert
87
50
27
111
99
42 90 105
58
32
68
43 60 70
51
1
Since 11 is Less than 87, we move to the left sub-tree
Since 11 is Less than 50, we move to the left sub-tree
Since 11 is Less than 27, we move to the left sub-tree
Since 11 is Greater than 1, we move to the right sub-tree
**Since no sub-tree, 11 is now added as the right leaf**
11
Predecessor
The node to delete is 50
Predecessor is found by finding the right most node of the 50 nodes left sub-tree
87
50
27
111
99
42 90 105
58
32
68
43 60 70
51
1
11
Sucsessor
Successor is found by finding the left most node of the 50
nodes right sub-tree
87
50
27
111
99
42 90 105
58
32
68
43 60 70
51
1
11
How to delete 50?
There is a left child so we find predecessor
To learn more about finding predecessor insert
<Fpred>starting value</Fpred> to data file
87
50
27
111
99
42 90 105
58
32
68
43 60 70
51
1
11
Delete
There is a left child so we find predecessor
This is how the new tree would appear
87
43
27
1
11
42
32
58
51 68
60 70
111
99
90 105
How to delete 105?
This is a Leaf case
We just remove this node from the tree
87
43
27
1
11
42
32
58
51 68
60 70
111
99
90 105
Delete
This is a Leaf case
This is how the new tree would appear
87
43
27
1
11
42
32
58
51 68
60 70
111
99
90
How to delete 87?
There is a left child so we find predecessor
To learn more about finding predicessor insert
<Fpred>starting value</Fpred> to data file
87
43
27
1
11
42
32
58
51 68
60 70
111
99
90
Delete
There is a left child so we find predecessor
This is how the new tree would appear
70
43
27
1
11
42
32
58
51 68
60
111
99
90
How to delete 111?
There is only one child, so replace the node with its only child
70
43
27
1
11
42
32
58
51 68
60
111
99
90
After 111 is replaced by its only child
There is only one child, so replace the node with its only child
70
43
27
1
11
42
32
58
51 68
60
99
90
PreOrder Traversal
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PreOrder Traversal
1.Visit the root
2.Visit the left sub-tree
3.Visit the right sub-tree
InOrder Traversal
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
70
43
27
1
11
42
32
58
51 68
60
111
99
90
InOrder Traversal
1.Visit the left sub-tree
2.Visit the root
3.Visit the right sub-tree
PostOrder Traversal
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root
70
43
27
1
11
42
32
58
51 68
60
111
99
90
PostOrder Traversal
1.Visit the left sub-tree
2.Visit the right sub-tree
3.Visit the root

More Related Content

Similar to Basic Terminologies of Tree and Tree Traversal methods.pptx

358 33 powerpoint-slides_10-trees_chapter-10
358 33 powerpoint-slides_10-trees_chapter-10358 33 powerpoint-slides_10-trees_chapter-10
358 33 powerpoint-slides_10-trees_chapter-10sumitbardhan
 
Farhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructureFarhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructureFarhana Shaikh
 
tree traversals.pdf
tree traversals.pdftree traversals.pdf
tree traversals.pdfMaryJacob24
 
Trees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and AlgorithmsTrees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and AlgorithmsBHARATH KUMAR
 
Describe the tree data structure- What is a root node- What is a child.docx
Describe the tree data structure- What is a root node- What is a child.docxDescribe the tree data structure- What is a root node- What is a child.docx
Describe the tree data structure- What is a root node- What is a child.docxandyb37
 
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 presentationnakulvarshney371
 
NON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptxNON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptxRajitha Reddy Alugati
 
Cinterviews Binarysearch Tree
Cinterviews Binarysearch TreeCinterviews Binarysearch Tree
Cinterviews Binarysearch Treecinterviews
 
tree Data Structures in python Traversals.pptx
tree Data Structures in python Traversals.pptxtree Data Structures in python Traversals.pptx
tree Data Structures in python Traversals.pptxRupaRaj6
 
discrete mathematics binary%20trees.pptx
discrete mathematics binary%20trees.pptxdiscrete mathematics binary%20trees.pptx
discrete mathematics binary%20trees.pptxansariparveen06
 
7 chapter4 trees_binary
7 chapter4 trees_binary7 chapter4 trees_binary
7 chapter4 trees_binarySSE_AndyLi
 

Similar to Basic Terminologies of Tree and Tree Traversal methods.pptx (20)

Trees
TreesTrees
Trees
 
358 33 powerpoint-slides_10-trees_chapter-10
358 33 powerpoint-slides_10-trees_chapter-10358 33 powerpoint-slides_10-trees_chapter-10
358 33 powerpoint-slides_10-trees_chapter-10
 
Farhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructureFarhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructure
 
Tree
TreeTree
Tree
 
tree traversals.pdf
tree traversals.pdftree traversals.pdf
tree traversals.pdf
 
Trees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and AlgorithmsTrees and Graphs in data structures and Algorithms
Trees and Graphs in data structures and Algorithms
 
Describe the tree data structure- What is a root node- What is a child.docx
Describe the tree data structure- What is a root node- What is a child.docxDescribe the tree data structure- What is a root node- What is a child.docx
Describe the tree data structure- What is a root node- What is a child.docx
 
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
 
NON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptxNON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptx
 
Unit 3,4.docx
Unit 3,4.docxUnit 3,4.docx
Unit 3,4.docx
 
Cinterviews Binarysearch Tree
Cinterviews Binarysearch TreeCinterviews Binarysearch Tree
Cinterviews Binarysearch Tree
 
tree Data Structures in python Traversals.pptx
tree Data Structures in python Traversals.pptxtree Data Structures in python Traversals.pptx
tree Data Structures in python Traversals.pptx
 
Trees
TreesTrees
Trees
 
discrete mathematics binary%20trees.pptx
discrete mathematics binary%20trees.pptxdiscrete mathematics binary%20trees.pptx
discrete mathematics binary%20trees.pptx
 
7 chapter4 trees_binary
7 chapter4 trees_binary7 chapter4 trees_binary
7 chapter4 trees_binary
 
Tree
TreeTree
Tree
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
 
Binary tree
Binary treeBinary tree
Binary tree
 
Tree
TreeTree
Tree
 
Ch12 Tree
Ch12 TreeCh12 Tree
Ch12 Tree
 

Recently uploaded

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(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
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
(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
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
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
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
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
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 

Recently uploaded (20)

GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
(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
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
(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...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
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...
 
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
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
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
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 

Basic Terminologies of Tree and Tree Traversal methods.pptx