SlideShare a Scribd company logo
Chapter 7
Binary Threaded Tree
AVL Tree (Adelson, Velski, Landis)
 AVL tree is a special kind tree in which the balance
factor of each can not be more than 0, 1 or -1.
 It also called as height balanced tree.
 Or we can say that height of two child sub tree of any
node differ at most by one where left and right sub
trees again AVL Tree.
By Prof. Raj Sarode 2
Balance Factor (BF) = Height of the left sub tree -
Height of the Right Sub tree
Or
BF = HL – HR
By Prof. Raj Sarode 3
E.g.
A
B
C
D
BF = 0 - 3 = -3
BF = 0 -2 = - 2
BF = 0 - 1 = -1
BF = 0 - 0 = 0
C
A
B
D
E
BF = 0 - 0 = 0
BF = 0 - 1 = -1
BF = 0 - 0 = 0
BF = 0 - 1 = -1
BF = 0 - 0 = 0
(a) Unbalance BST (b) Balance BST
Note:
BF = -1 i.e. right sub tree is higher than left sub tree or it is called right heavy tree
BF = 1 i.e. left sub tree is higher than right sub tree or it is called as left heavy tree.
BF = 0 i.e. Both sub tree are on same height.
By Prof. Raj Sarode 4
Representation of AVL Tree
AVL Tree can also be represented or implemented as other tree in memory
with an additional field to keep track of balance factor.
The balance factor of node represents the difference of height between the
left sub tree and right sub tree of the node.
Left Info Right BF
Structure of AVL Tree node
Struct Node
{
Node * Left;
Int Info;
Node * Right;
Int BF;
};
Node * root;Building AVL Tree or Height Balance Tree
AVL Tree is constructed by using the same process as applied to BST.
The only thing we need to remember that it follow the property of height
balance tree (BF).
The balance factor of each node can be 0, 1 or -1.
While the insertion of deletion is preformed, the tree become unbalanced and
violate the property of AVL tree that time we have to apply different rotation on
the AVL Tree
AVL Tree Rotation
By Prof. Raj Sarode 5
A
B
C
BF = 0 -2 = - 2
BF = 0 - 1 = -1
BF = 0 - 0 = 0
R R
A
B
CBF = 0 - 0 = 0
BF = 1 - 1 = 0
BF = 0 - 0 = 0
A
B
C
BF = 2 - 0 = 2
BF = 1 - 0 = 1
BF = 0 - 0 = 0
L L
C
B
ABF = 0 - 0 = 0
BF = 1 - 1 = 0
BF = 0 - 0 = 0
1. Left to Left Rotation
2. Right to Right Rotation
AVL Tree Rotation
By Prof. Raj Sarode 6
A
B
C
BF = 0 - 2 = - 2
BF = 1 - 0 = 1
BF = 0 - 0 = 0
R L
A
C
BBF = 0 - 0 = 0
BF = 1 - 1 = 0
BF = 0 - 0 = 0
A
B
C
BF = 2 - 0 = 2
BF = 0 - 1 = -1
BF = 0 - 0 = 0
L R
B
C
ABF = 0 - 0 = 0
BF = 1 - 1 = 0
BF = 0 - 0 = 0
3. Left to Right Rotation
4. Right to Left Rotation
By Prof. Raj Sarode 7
Sr.
No.
I/P Node Tree Rotation
1 Tree is balanced
2 Tree is balanced
3 Tree is balanced
23 BF = 0 - 0 = 023
12
23
12
1
0
82 23
12
1
0
82
0
e.g. 23, 12, 82, 15, 16, 57, 50
By Prof. Raj Sarode 8
Sr.
No.
I/P Node Tree Rotation
4 Tree is balanced
5
Now Tree is balanced
15
16
23
12
1
-1
82
0
15
0
23
12
1
-2
82
0
15
-1
16
0
23
12
8215
16
R R
0 0
00
1
e.g. 23, 12, 82, 15, 16, 57, 50
By Prof. Raj Sarode 9
e.g. 23, 12, 82, 15, 16, 57, 50
Sr.
No.
I/P Node Tree Rotation
6 Tree is balanced
7
Now Tree is balanced
57
23
12
8215
16 57
0 0 0
0 1
0
50 23
12
8215
16 57
50
0 0
0
0
1
2
-1
23
12 82
15
16
57
50
0 0
0
0 0
0
0
L L
Expression Tree
By Prof. Raj Sarode 10
All arithmetic operation are unary or binary so expression tree are generally binary
Left child represent the left operand.
Right child represent the right operand.
In case of unary operator a node can have only one child.
Root node always contains the operator.
Parenthesis are evaluated first then the exponent, followed by multiplication or
division & then addition or subtraction.
E.g.
A + B
A
+
B
By Prof. Raj Sarode 11
E.g. ( A – B * C ) / ( D + E / F )
B
*
C
Step :1 First parenthesis is evaluated so construct the tree for (A – B * C )
B
*
C
A
-
B * C Then (A - B * C)
Step :2 Second parenthesis is evaluated so construct the tree for (D + E / F )
E
/
F
E
/
F
D
+
E / F Then (D + E / F )
By Prof. Raj Sarode 12
E.g. ( A – B * C ) / ( D + E / F )
Step :3 Result of First parenthesis is divided by second parenthesis
B
*
C
A
-
E
/
F
D
+
/
In-order: (A-B*C)/(D+E/F)
Pre-order: / + D / E F – A * B C
Post- order: D E F / + A B C * - /
Since expression is also binary tree so it can also be traversed in three different ways
B Tree
By Prof. Raj Sarode 13
In previous section we learn BST, AVL Tree and Expression Tree but the problem is
that no. of node is more then height of tree is increased also and will consume
more time for different operation.
So to remove such drawback we introduce M way tree or B Tree having following
properties
1. Each node can contain N-1 key elements, where N is the order of tree
2. Each node can have N branches.
3. The root is either a leaf or it has 2 to n sub tree, where N is the order of B tree.
4. All nodes expect the root and leaves can have minimum N/2 and Maximum N
Branches.
5. All the leaf nodes are on the same level so tree is balanced.
6. When the new node is inserted into full node (with N-1 elements), then the
node is split in to two new node at the same level and key with the median
value is inserted in the parent node in case the parent node is the root, a new
root will be created.
7. Full node condition is called the overflow.
By Prof. Raj Sarode 14
Construct the B-Tree of order 4 for the following elements
1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20
1
1 6
1 6 8
2 6 81 2
6
81
2
6
81 9
Insert 1
Insert 6
Insert 8
Insert 2
Insert 9
By Prof. Raj Sarode 15
Construct the B-Tree of order 4 for the following elements
1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20
2
6
81 9 12
Insert 12
2
6
81 9 12 15
Insert 15
2
6
81
9
12 15
2
6
81
9
12 15
Insert 7
7
2
6
81
9
12 157
Insert 18
18
By Prof. Raj Sarode 16
Construct the B-Tree of order 4 for the following elements
1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20
3
6
82
9
12 157
Insert 3
181
4
6
82
9
12 157
Insert 4
181 3
4
6
8
2 9
12 157 181 3
By Prof. Raj Sarode 17
Construct the B-Tree of order 4 for the following elements
1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20
Insert 20
4
6
8
2 9
12 157 181 3 20
4
6
8
2 9
12
15
7 181 3 20
4
6
8
2 9
12
15
7 181 3 20 Final B Tree
By Prof. Raj Sarode 18
Construct the B-Tree of order 4 for the following elements
1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20
Delete 15
4
6
8
2 9
12
15
7 181 3 20
Final B Tree
4
6
8
2 9
12
18
7 201 3
By Prof. Raj Sarode 19
Construct the B-Tree of order 4 for the following elements
1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20
Delete 12
Final B Tree
4
6
8
2 9
12
18
7 201 3
4
6
8
2 9 18
7 201 3
B+ Tree
By Prof. Raj Sarode 20
In B Tree we can access record only in random , we cannot traverse the records
sequentially.
After finding particular record we can not get to get the previous or next record but B+
tree has both properties, random access as well as sequential traversal.
In B+ tree the structure of leaf node & internal node is different
Internal node only store keys and child pointer.
Leaf node store keys & Corresponding data items so data items present only in leaf
node
Threaded Binary Tree
By Prof. Raj Sarode 21
Binary trees have a lot of wasted space: the leaf nodes each have 2 null
pointers
We can use these pointers to help us in in-order traversals
Thread: a pointer to other nodes in the tree for replacing the 0-link.
We have the pointers reference the next node in an in-order traversal;
called threads
We need to know if a pointer is an actual link or a thread, so we keep a
Boolean for each pointer
Thank You
By Prof. Raj Sarode 22

More Related Content

PPTX
Linked list
PPTX
Stack and queue
PPTX
AVL Tree Data Structure
PPTX
Data structure - Graph
PPTX
Data Structures - Lecture 9 [Stack & Queue using Linked List]
PPT
Data Structures with C Linked List
PPS
Single linked list
PDF
Binary search tree operations
Linked list
Stack and queue
AVL Tree Data Structure
Data structure - Graph
Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures with C Linked List
Single linked list
Binary search tree operations

What's hot (20)

PPTX
Circular link list.ppt
PPTX
Doubly Linked List
PPTX
single linked list
PPTX
Tree in data structure
PPTX
Linked List - Insertion & Deletion
PDF
Double ended queue
PPTX
Priority Queue in Data Structure
PDF
Trees, Binary Search Tree, AVL Tree in Data Structures
PPT
Heap sort
PPSX
Data structure stack&queue basics
PPTX
Different types of Linked list.
PPTX
Data structures trees - B Tree & B+Tree.pptx
PPTX
LINKED LIST.pptx
PPTX
Binary Search Tree
PPTX
linked list
PPTX
Linked stacks and queues
PPTX
Queue Implementation Using Array & Linked List
Circular link list.ppt
Doubly Linked List
single linked list
Tree in data structure
Linked List - Insertion & Deletion
Double ended queue
Priority Queue in Data Structure
Trees, Binary Search Tree, AVL Tree in Data Structures
Heap sort
Data structure stack&queue basics
Different types of Linked list.
Data structures trees - B Tree & B+Tree.pptx
LINKED LIST.pptx
Binary Search Tree
linked list
Linked stacks and queues
Queue Implementation Using Array & Linked List
Ad

Viewers also liked (20)

PPTX
Chap 8 graph
PPTX
Simulations chapter 7
KEY
Introduction to Games and Simulations
PDF
Simulations and Games
PDF
Applying Game Concepts To Learning
DOCX
A Comparison of Traditional Simulation and MSAL (6-3-2015)
PPTX
Avl tree by umesh
PPTX
Gamification, Serious Games and Simulations
PPT
Binary plan
PPTX
Games & Simulations as Learning Technology Tools
PDF
How hackers embarrassed technology
PPT
REALITY THE SIMULATION
PPTX
Transform your training with simulations speaker deck - march 2011
PPT
Transform Your Training Projects with Games and Simulations
PPTX
6 ict tutorial create a family tree chart in power point 2007
PPT
Ppp Of Simulation Development2
PPTX
stack
PPTX
Chap 1 introduction to cloud computing
PPTX
Chap 6 cloud security
PDF
Jeunesse quickstarterv12
Chap 8 graph
Simulations chapter 7
Introduction to Games and Simulations
Simulations and Games
Applying Game Concepts To Learning
A Comparison of Traditional Simulation and MSAL (6-3-2015)
Avl tree by umesh
Gamification, Serious Games and Simulations
Binary plan
Games & Simulations as Learning Technology Tools
How hackers embarrassed technology
REALITY THE SIMULATION
Transform your training with simulations speaker deck - march 2011
Transform Your Training Projects with Games and Simulations
6 ict tutorial create a family tree chart in power point 2007
Ppp Of Simulation Development2
stack
Chap 1 introduction to cloud computing
Chap 6 cloud security
Jeunesse quickstarterv12
Ad

Similar to Chap 7 binary threaded tree (20)

PDF
Avl tree
PPTX
AVL Tree concept in data structures.pptx
PPTX
PPTX
PPTX
Binary tree data structure
PDF
Sienna6bst 120411102353-phpapp02
PPT
PPT 2.5 AVL Trees is a ppt from trees topic dsa.ppt
PPTX
Heap types & Trees
PPTX
Data structures 3
PPTX
datastructurestreeand type of trees.pptx
PDF
Lect 13, 14 (final)AVL Tree and Rotations.pdf
PPTX
mod 2.2 avl_red_black.pptx with good explanations
PPTX
DS-UNIT-4zjufrusefihfacbciauhfbaiuhc.pptx
PDF
AVL Tree lecture slide with all rotations
PPTX
4.Problem Solving Techniques and Data Structures.pptx
PPT
data_structures_and_applications_-_module-4.ppt
PPTX
PPTX
Unit-VStackStackStackStackStackStack.pptx
PPTX
SEARCHING AND SORTING ALGORITHMS, TYPES OF SORTING
PPT
16-avl-trees.ppt data structures prestentation
Avl tree
AVL Tree concept in data structures.pptx
Binary tree data structure
Sienna6bst 120411102353-phpapp02
PPT 2.5 AVL Trees is a ppt from trees topic dsa.ppt
Heap types & Trees
Data structures 3
datastructurestreeand type of trees.pptx
Lect 13, 14 (final)AVL Tree and Rotations.pdf
mod 2.2 avl_red_black.pptx with good explanations
DS-UNIT-4zjufrusefihfacbciauhfbaiuhc.pptx
AVL Tree lecture slide with all rotations
4.Problem Solving Techniques and Data Structures.pptx
data_structures_and_applications_-_module-4.ppt
Unit-VStackStackStackStackStackStack.pptx
SEARCHING AND SORTING ALGORITHMS, TYPES OF SORTING
16-avl-trees.ppt data structures prestentation

Recently uploaded (20)

PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Online Work Permit System for Fast Permit Processing
PDF
System and Network Administraation Chapter 3
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Introduction to Artificial Intelligence
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
AI in Product Development-omnex systems
PPT
Introduction Database Management System for Course Database
PPTX
L1 - Introduction to python Backend.pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
System and Network Administration Chapter 2
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
CHAPTER 2 - PM Management and IT Context
VVF-Customer-Presentation2025-Ver1.9.pptx
Online Work Permit System for Fast Permit Processing
System and Network Administraation Chapter 3
Understanding Forklifts - TECH EHS Solution
Upgrade and Innovation Strategies for SAP ERP Customers
Introduction to Artificial Intelligence
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Softaken Excel to vCard Converter Software.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
AI in Product Development-omnex systems
Introduction Database Management System for Course Database
L1 - Introduction to python Backend.pptx
PTS Company Brochure 2025 (1).pdf.......
Navsoft: AI-Powered Business Solutions & Custom Software Development
Odoo Companies in India – Driving Business Transformation.pdf
System and Network Administration Chapter 2
How to Choose the Right IT Partner for Your Business in Malaysia
CHAPTER 2 - PM Management and IT Context

Chap 7 binary threaded tree

  • 2. AVL Tree (Adelson, Velski, Landis)  AVL tree is a special kind tree in which the balance factor of each can not be more than 0, 1 or -1.  It also called as height balanced tree.  Or we can say that height of two child sub tree of any node differ at most by one where left and right sub trees again AVL Tree. By Prof. Raj Sarode 2 Balance Factor (BF) = Height of the left sub tree - Height of the Right Sub tree Or BF = HL – HR
  • 3. By Prof. Raj Sarode 3 E.g. A B C D BF = 0 - 3 = -3 BF = 0 -2 = - 2 BF = 0 - 1 = -1 BF = 0 - 0 = 0 C A B D E BF = 0 - 0 = 0 BF = 0 - 1 = -1 BF = 0 - 0 = 0 BF = 0 - 1 = -1 BF = 0 - 0 = 0 (a) Unbalance BST (b) Balance BST Note: BF = -1 i.e. right sub tree is higher than left sub tree or it is called right heavy tree BF = 1 i.e. left sub tree is higher than right sub tree or it is called as left heavy tree. BF = 0 i.e. Both sub tree are on same height.
  • 4. By Prof. Raj Sarode 4 Representation of AVL Tree AVL Tree can also be represented or implemented as other tree in memory with an additional field to keep track of balance factor. The balance factor of node represents the difference of height between the left sub tree and right sub tree of the node. Left Info Right BF Structure of AVL Tree node Struct Node { Node * Left; Int Info; Node * Right; Int BF; }; Node * root;Building AVL Tree or Height Balance Tree AVL Tree is constructed by using the same process as applied to BST. The only thing we need to remember that it follow the property of height balance tree (BF). The balance factor of each node can be 0, 1 or -1. While the insertion of deletion is preformed, the tree become unbalanced and violate the property of AVL tree that time we have to apply different rotation on the AVL Tree
  • 5. AVL Tree Rotation By Prof. Raj Sarode 5 A B C BF = 0 -2 = - 2 BF = 0 - 1 = -1 BF = 0 - 0 = 0 R R A B CBF = 0 - 0 = 0 BF = 1 - 1 = 0 BF = 0 - 0 = 0 A B C BF = 2 - 0 = 2 BF = 1 - 0 = 1 BF = 0 - 0 = 0 L L C B ABF = 0 - 0 = 0 BF = 1 - 1 = 0 BF = 0 - 0 = 0 1. Left to Left Rotation 2. Right to Right Rotation
  • 6. AVL Tree Rotation By Prof. Raj Sarode 6 A B C BF = 0 - 2 = - 2 BF = 1 - 0 = 1 BF = 0 - 0 = 0 R L A C BBF = 0 - 0 = 0 BF = 1 - 1 = 0 BF = 0 - 0 = 0 A B C BF = 2 - 0 = 2 BF = 0 - 1 = -1 BF = 0 - 0 = 0 L R B C ABF = 0 - 0 = 0 BF = 1 - 1 = 0 BF = 0 - 0 = 0 3. Left to Right Rotation 4. Right to Left Rotation
  • 7. By Prof. Raj Sarode 7 Sr. No. I/P Node Tree Rotation 1 Tree is balanced 2 Tree is balanced 3 Tree is balanced 23 BF = 0 - 0 = 023 12 23 12 1 0 82 23 12 1 0 82 0 e.g. 23, 12, 82, 15, 16, 57, 50
  • 8. By Prof. Raj Sarode 8 Sr. No. I/P Node Tree Rotation 4 Tree is balanced 5 Now Tree is balanced 15 16 23 12 1 -1 82 0 15 0 23 12 1 -2 82 0 15 -1 16 0 23 12 8215 16 R R 0 0 00 1 e.g. 23, 12, 82, 15, 16, 57, 50
  • 9. By Prof. Raj Sarode 9 e.g. 23, 12, 82, 15, 16, 57, 50 Sr. No. I/P Node Tree Rotation 6 Tree is balanced 7 Now Tree is balanced 57 23 12 8215 16 57 0 0 0 0 1 0 50 23 12 8215 16 57 50 0 0 0 0 1 2 -1 23 12 82 15 16 57 50 0 0 0 0 0 0 0 L L
  • 10. Expression Tree By Prof. Raj Sarode 10 All arithmetic operation are unary or binary so expression tree are generally binary Left child represent the left operand. Right child represent the right operand. In case of unary operator a node can have only one child. Root node always contains the operator. Parenthesis are evaluated first then the exponent, followed by multiplication or division & then addition or subtraction. E.g. A + B A + B
  • 11. By Prof. Raj Sarode 11 E.g. ( A – B * C ) / ( D + E / F ) B * C Step :1 First parenthesis is evaluated so construct the tree for (A – B * C ) B * C A - B * C Then (A - B * C) Step :2 Second parenthesis is evaluated so construct the tree for (D + E / F ) E / F E / F D + E / F Then (D + E / F )
  • 12. By Prof. Raj Sarode 12 E.g. ( A – B * C ) / ( D + E / F ) Step :3 Result of First parenthesis is divided by second parenthesis B * C A - E / F D + / In-order: (A-B*C)/(D+E/F) Pre-order: / + D / E F – A * B C Post- order: D E F / + A B C * - / Since expression is also binary tree so it can also be traversed in three different ways
  • 13. B Tree By Prof. Raj Sarode 13 In previous section we learn BST, AVL Tree and Expression Tree but the problem is that no. of node is more then height of tree is increased also and will consume more time for different operation. So to remove such drawback we introduce M way tree or B Tree having following properties 1. Each node can contain N-1 key elements, where N is the order of tree 2. Each node can have N branches. 3. The root is either a leaf or it has 2 to n sub tree, where N is the order of B tree. 4. All nodes expect the root and leaves can have minimum N/2 and Maximum N Branches. 5. All the leaf nodes are on the same level so tree is balanced. 6. When the new node is inserted into full node (with N-1 elements), then the node is split in to two new node at the same level and key with the median value is inserted in the parent node in case the parent node is the root, a new root will be created. 7. Full node condition is called the overflow.
  • 14. By Prof. Raj Sarode 14 Construct the B-Tree of order 4 for the following elements 1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20 1 1 6 1 6 8 2 6 81 2 6 81 2 6 81 9 Insert 1 Insert 6 Insert 8 Insert 2 Insert 9
  • 15. By Prof. Raj Sarode 15 Construct the B-Tree of order 4 for the following elements 1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20 2 6 81 9 12 Insert 12 2 6 81 9 12 15 Insert 15 2 6 81 9 12 15 2 6 81 9 12 15 Insert 7 7 2 6 81 9 12 157 Insert 18 18
  • 16. By Prof. Raj Sarode 16 Construct the B-Tree of order 4 for the following elements 1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20 3 6 82 9 12 157 Insert 3 181 4 6 82 9 12 157 Insert 4 181 3 4 6 8 2 9 12 157 181 3
  • 17. By Prof. Raj Sarode 17 Construct the B-Tree of order 4 for the following elements 1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20 Insert 20 4 6 8 2 9 12 157 181 3 20 4 6 8 2 9 12 15 7 181 3 20 4 6 8 2 9 12 15 7 181 3 20 Final B Tree
  • 18. By Prof. Raj Sarode 18 Construct the B-Tree of order 4 for the following elements 1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20 Delete 15 4 6 8 2 9 12 15 7 181 3 20 Final B Tree 4 6 8 2 9 12 18 7 201 3
  • 19. By Prof. Raj Sarode 19 Construct the B-Tree of order 4 for the following elements 1, 6, 8, 2, 9, 12, 15, 7, 18, 3, 4, 20 Delete 12 Final B Tree 4 6 8 2 9 12 18 7 201 3 4 6 8 2 9 18 7 201 3
  • 20. B+ Tree By Prof. Raj Sarode 20 In B Tree we can access record only in random , we cannot traverse the records sequentially. After finding particular record we can not get to get the previous or next record but B+ tree has both properties, random access as well as sequential traversal. In B+ tree the structure of leaf node & internal node is different Internal node only store keys and child pointer. Leaf node store keys & Corresponding data items so data items present only in leaf node
  • 21. Threaded Binary Tree By Prof. Raj Sarode 21 Binary trees have a lot of wasted space: the leaf nodes each have 2 null pointers We can use these pointers to help us in in-order traversals Thread: a pointer to other nodes in the tree for replacing the 0-link. We have the pointers reference the next node in an in-order traversal; called threads We need to know if a pointer is an actual link or a thread, so we keep a Boolean for each pointer
  • 22. Thank You By Prof. Raj Sarode 22