SlideShare a Scribd company logo
Topic
B+ TREES
Presented by:
Mujahid Hussain Jalbanee
(Student of Software Engineering)
Tree:
 Tree is collection of nodes.
 Nodes have data and pointers.
 Pointers can be dynamic and can be thousands.
 Files are just like leaves.
 1st node called Root.
 Sibling nodes have same parent node.
 Path means to go towards particular node.
B+ Trees:
 Every node has pointers to other nodes and key values.
 If there are N pointers then there can be N-1 number of key
values.
 Key values are repeated from root node to leaf node because
data pointers are located at leaf nodes.
B+ Trees Structure.
A B
Values < A
Values >=A && <B
Values >= B
B+ Tree Insertion:
 Lets take the following elements
2, 5, 7, 10, 13, 16, 20, 22, 23, 24….
 Let be number of pointer, indirectly, 3 key values can be there in
a node at a maximum case….
 Insert 2,5,7….
 Now insert 10….
2 5 7
Continue……..
 When we insert 10 then node will be break down into two..
 After inserting 10..
 There should be a parent to look after when there nodes > 1, so
copy 7 into parent node….
2 5 7 10
Lets see….
Insert 13, 16….. Node again breaks
7
2 5 7 10
Continue……
 After inserting 13 and 16….
 Nodes over flows….
 After insertion….
7 10 13 16
2 5 13 16
7 13
7 10
Continue…..
Insert 20 and 22
Violation… above 3 keys… again break up… 13 and 16 in one 20
and 22 will be in another new node… and then should copy in the
parent node….
13 16 20 22
2 5 7 10 13 16 20 22
7 13 20
 Now lets insert 23 and 24… we can directly insert 23….
7 13 20
2 5 7 10 13 16 20 22 23
 Now insert 24…. Node over flows…
 So, we should break up and copy 23 to the parent.. But this
time parent node is over flows..
 Now break down parent node and move the smallest element
from second partition to newly created parent node…
20 22 23 24
 After inserting 24….
13
7 20 23
2 5 23 2420 2213 167 10
 When number of search-key values < (n/2)-1
LEAF NODE
 Redistribute to sibling
Right node not less than left node
Replace the between-value in parent by their smallest value of
right node…
Merge (contain too few entries)
Move all values, pointer to left node
Remove the between-value in parent…
B+ Trees Deletion
13 18
9 13
13 14 169 10
14 16
14 18
 Now delete 10….
After Deletion…..
Now delete 10….
 After deletion….
9 10 13 14
18 22
13 18 22
9 13 14
 Non-Leaf Node..
Redistribute to sibling
Though parent
Right node not less than left node
Merge(contain too few entries)
Bring down parent
Move all values, pointers to left node
Delete the right node, and pointers in parent….
5 20
83
31 Some sub tree
Now delete 3, where n=3….
After deletion 3….
20
5 8
1
Some sub tree
Advantages:
Automatically adjust the nodes to fit the new records.
It re-organizes the nodes in the case of delete.
Good space utilization nodes contain only to the pointers to
the records and leaf nodes contain records.
It is suitable for partial and range search too.
Disadvantages:
There is no rearrangement of nodes while insertion or
deletion, then it would be an overhead.
It takes little effort, time and space.
But this disadvantage can be ignored compared to the speed
of traversal.
B+ Tree
B+ Tree

More Related Content

What's hot

Red black tree
Red black treeRed black tree
Red black tree
Dr Sandeep Kumar Poonia
 
Splay Tree
Splay TreeSplay Tree
Spanning trees
Spanning treesSpanning trees
Spanning trees
Shareb Ismaeel
 
Avl tree
Avl treeAvl tree
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
Janki Shah
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
ManishPrajapati78
 
Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures
Gurukul Kangri Vishwavidyalaya - Faculty of Engineering and Technology
 
Heap sort
Heap sortHeap sort
Heap sort
Mohd Arif
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
Muhazzab Chouhadry
 
b+ tree
b+ treeb+ tree
b+ tree
bitistu
 
Data Structure (Tree)
Data Structure (Tree)Data Structure (Tree)
Data Structure (Tree)
Adam Mukharil Bachtiar
 
Avl trees
Avl treesAvl trees
Avl trees
amna izzat
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
sagar yadav
 
Binary tree
Binary treeBinary tree
Binary tree
Rajendran
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
Lemia Algmri
 
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
United International University
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
khabbab_h
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
ManishPrajapati78
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
Hossain Md Shakhawat
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
Sajid Marwat
 

What's hot (20)

Red black tree
Red black treeRed black tree
Red black tree
 
Splay Tree
Splay TreeSplay Tree
Splay Tree
 
Spanning trees
Spanning treesSpanning trees
Spanning trees
 
Avl tree
Avl treeAvl tree
Avl tree
 
Queue in Data Structure
Queue in Data Structure Queue in Data Structure
Queue in Data Structure
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
 
Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures Trees, Binary Search Tree, AVL Tree in Data Structures
Trees, Binary Search Tree, AVL Tree in Data Structures
 
Heap sort
Heap sortHeap sort
Heap sort
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
 
b+ tree
b+ treeb+ tree
b+ tree
 
Data Structure (Tree)
Data Structure (Tree)Data Structure (Tree)
Data Structure (Tree)
 
Avl trees
Avl treesAvl trees
Avl trees
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Binary tree
Binary treeBinary tree
Binary tree
 
heap Sort Algorithm
heap  Sort Algorithmheap  Sort Algorithm
heap Sort Algorithm
 
Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)Balanced Tree (AVL Tree & Red-Black Tree)
Balanced Tree (AVL Tree & Red-Black Tree)
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
 
Data Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search TreeData Structure and Algorithms Binary Search Tree
Data Structure and Algorithms Binary Search Tree
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
 

Similar to B+ Tree

Trees
TreesTrees
Best for b trees
Best for b treesBest for b trees
Best for b trees
DineshRaaja
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
part4-trees.ppt
part4-trees.pptpart4-trees.ppt
part4-trees.ppt
Suneel61
 
CS-102 BST_27_3_14v2.pdf
CS-102 BST_27_3_14v2.pdfCS-102 BST_27_3_14v2.pdf
CS-102 BST_27_3_14v2.pdf
ssuser034ce1
 
13-Doubly Linked List data structure.pdf
13-Doubly Linked List data structure.pdf13-Doubly Linked List data structure.pdf
13-Doubly Linked List data structure.pdf
ssusere3b1a2
 
17 linkedlist (1)
17 linkedlist (1)17 linkedlist (1)
17 linkedlist (1)
Himadri Sen Gupta
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
JAGDEEPKUMAR23
 
CS-102 BST_27_3_14.pdf
CS-102 BST_27_3_14.pdfCS-102 BST_27_3_14.pdf
CS-102 BST_27_3_14.pdf
ssuser034ce1
 
Indexing.ppt
Indexing.pptIndexing.ppt
Indexing.ppt
KalsoomTahir2
 
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmmIndexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
RAtna29
 
NON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptxNON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptx
Rajitha Reddy Alugati
 
B-Tree
B-TreeB-Tree
Linkedlist
LinkedlistLinkedlist
Linkedlist
Masud Parvaze
 
Data structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptxData structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptx
MalligaarjunanN
 
Trees
TreesTrees
109885098-B-Trees-And-B-Trees in data structure.ppt
109885098-B-Trees-And-B-Trees in data structure.ppt109885098-B-Trees-And-B-Trees in data structure.ppt
109885098-B-Trees-And-B-Trees in data structure.ppt
ssuser19bb13
 
Introduction to data structure by anil dutt
Introduction to data structure by anil duttIntroduction to data structure by anil dutt
Introduction to data structure by anil dutt
Anil Dutt
 
7.tree
7.tree7.tree
IEEE 754 Standards For Floating Point Representation.pdf
IEEE 754 Standards For Floating Point   Representation.pdfIEEE 754 Standards For Floating Point   Representation.pdf
IEEE 754 Standards For Floating Point Representation.pdf
kkumaraditya301
 

Similar to B+ Tree (20)

Trees
TreesTrees
Trees
 
Best for b trees
Best for b treesBest for b trees
Best for b trees
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 3.ppt
 
part4-trees.ppt
part4-trees.pptpart4-trees.ppt
part4-trees.ppt
 
CS-102 BST_27_3_14v2.pdf
CS-102 BST_27_3_14v2.pdfCS-102 BST_27_3_14v2.pdf
CS-102 BST_27_3_14v2.pdf
 
13-Doubly Linked List data structure.pdf
13-Doubly Linked List data structure.pdf13-Doubly Linked List data structure.pdf
13-Doubly Linked List data structure.pdf
 
17 linkedlist (1)
17 linkedlist (1)17 linkedlist (1)
17 linkedlist (1)
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
CS-102 BST_27_3_14.pdf
CS-102 BST_27_3_14.pdfCS-102 BST_27_3_14.pdf
CS-102 BST_27_3_14.pdf
 
Indexing.ppt
Indexing.pptIndexing.ppt
Indexing.ppt
 
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmmIndexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
Indexing.ppt mmmmmmmmmmmmmmmmmmmmmmmmmmmmm
 
NON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptxNON-LINEAR DATA STRUCTURE-TREES.pptx
NON-LINEAR DATA STRUCTURE-TREES.pptx
 
B-Tree
B-TreeB-Tree
B-Tree
 
Linkedlist
LinkedlistLinkedlist
Linkedlist
 
Data structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptxData structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptx
 
Trees
TreesTrees
Trees
 
109885098-B-Trees-And-B-Trees in data structure.ppt
109885098-B-Trees-And-B-Trees in data structure.ppt109885098-B-Trees-And-B-Trees in data structure.ppt
109885098-B-Trees-And-B-Trees in data structure.ppt
 
Introduction to data structure by anil dutt
Introduction to data structure by anil duttIntroduction to data structure by anil dutt
Introduction to data structure by anil dutt
 
7.tree
7.tree7.tree
7.tree
 
IEEE 754 Standards For Floating Point Representation.pdf
IEEE 754 Standards For Floating Point   Representation.pdfIEEE 754 Standards For Floating Point   Representation.pdf
IEEE 754 Standards For Floating Point Representation.pdf
 

Recently uploaded

Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
Marcin Chrost
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 

Recently uploaded (20)

Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !Enums On Steroids - let's look at sealed classes !
Enums On Steroids - let's look at sealed classes !
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 

B+ Tree

  • 1. Topic B+ TREES Presented by: Mujahid Hussain Jalbanee (Student of Software Engineering)
  • 2. Tree:  Tree is collection of nodes.  Nodes have data and pointers.  Pointers can be dynamic and can be thousands.  Files are just like leaves.  1st node called Root.  Sibling nodes have same parent node.  Path means to go towards particular node.
  • 3. B+ Trees:  Every node has pointers to other nodes and key values.  If there are N pointers then there can be N-1 number of key values.  Key values are repeated from root node to leaf node because data pointers are located at leaf nodes.
  • 4. B+ Trees Structure. A B Values < A Values >=A && <B Values >= B
  • 5. B+ Tree Insertion:  Lets take the following elements 2, 5, 7, 10, 13, 16, 20, 22, 23, 24….  Let be number of pointer, indirectly, 3 key values can be there in a node at a maximum case….  Insert 2,5,7….  Now insert 10…. 2 5 7
  • 6. Continue……..  When we insert 10 then node will be break down into two..  After inserting 10..  There should be a parent to look after when there nodes > 1, so copy 7 into parent node…. 2 5 7 10
  • 7. Lets see…. Insert 13, 16….. Node again breaks 7 2 5 7 10 Continue……
  • 8.  After inserting 13 and 16….  Nodes over flows….  After insertion…. 7 10 13 16 2 5 13 16 7 13 7 10 Continue…..
  • 9. Insert 20 and 22 Violation… above 3 keys… again break up… 13 and 16 in one 20 and 22 will be in another new node… and then should copy in the parent node…. 13 16 20 22 2 5 7 10 13 16 20 22 7 13 20
  • 10.  Now lets insert 23 and 24… we can directly insert 23…. 7 13 20 2 5 7 10 13 16 20 22 23
  • 11.  Now insert 24…. Node over flows…  So, we should break up and copy 23 to the parent.. But this time parent node is over flows..  Now break down parent node and move the smallest element from second partition to newly created parent node… 20 22 23 24
  • 12.  After inserting 24…. 13 7 20 23 2 5 23 2420 2213 167 10
  • 13.  When number of search-key values < (n/2)-1 LEAF NODE  Redistribute to sibling Right node not less than left node Replace the between-value in parent by their smallest value of right node… Merge (contain too few entries) Move all values, pointer to left node Remove the between-value in parent… B+ Trees Deletion
  • 14. 13 18 9 13 13 14 169 10 14 16 14 18  Now delete 10…. After Deletion…..
  • 15. Now delete 10….  After deletion…. 9 10 13 14 18 22 13 18 22 9 13 14
  • 16.  Non-Leaf Node.. Redistribute to sibling Though parent Right node not less than left node Merge(contain too few entries) Bring down parent Move all values, pointers to left node Delete the right node, and pointers in parent….
  • 17. 5 20 83 31 Some sub tree Now delete 3, where n=3….
  • 18. After deletion 3…. 20 5 8 1 Some sub tree
  • 19. Advantages: Automatically adjust the nodes to fit the new records. It re-organizes the nodes in the case of delete. Good space utilization nodes contain only to the pointers to the records and leaf nodes contain records. It is suitable for partial and range search too.
  • 20. Disadvantages: There is no rearrangement of nodes while insertion or deletion, then it would be an overhead. It takes little effort, time and space. But this disadvantage can be ignored compared to the speed of traversal.