SlideShare una empresa de Scribd logo
1 de 24
B + TREE
INTRODUCTION
A     B+ tree is a balanced tree in which every path from the
    root of the tree to a leaf is of the same length, and each
    non leaf node of the tree has between [n/2] and [n]
    children, where n is fixed for a particular tree.

    In a B+ tree, in contrast to a B-tree, all records are stored
    at the leaf level of the tree; only keys are stored in internal
    nodes.

 All    the leaf nodes are interconnected for faster access.

 Fill   factor is 50%.
EXAMPLE
   B+ Trees use a "fill factor" to control the growth and the
    shrinkage. A 50% fill factor would be the minimum for any
    B+.

Example : A B+ tree of order 5.

 Number of Keys 4
 Number of Pointers 5

 Fill Factor 50%

 Minimum Keys in each node 2
B+ TREE
                                 INTERNAL NODE / INDEX
                                 nodeS




               LEAF NODES / DATA nodeS


The linked list allows rapid in-order traversal.
OPERATIONS IN B+ TREE
   SEARCH

   INSERTION

   DELETION
B+ TREE- SEARCH OPERATION
TWO CASES:

 Successful   Search

 Unsuccessful   Search
SEARCHING
   Compare the key value with the data in the tree,
    then give the result back.
    For example: find the value 45, and 15 in below
    tree.
B+ TREE- INSERTION OPERATION

Inserting a record when

Case 1:If both leaf node and index node is not full.

Case 2:If leaf node is full and index node is not full.

Case 3:If both leaf node and index node is full.
INSERTION –CASE 1




         Add Record with Key 28
INSERTION –CASE 2

Adding a record when the leaf node is full but the index
node is not full.




   Add Record with Key 70
• This record should go in the leaf node containing
50, 55, 60, and 65.

      Left Leaf node       Right Leaf node
      50 55                60 65 70

    AFTER INSERTING A Record With Key 70.
INSERTION –CASE 3
Adding a record when both the leaf node and the index
node are full.

Add a record containing a key value of 95 to the
following tree.
This record belongs in the node containing 75, 80, 85, and
90. Since this node is full we split it into two nodes:

         Left Leaf Node      Right Leaf node
         75 80               85 90 95


 The middle key, 85, rises to the index node.

 But the index node is also full, so we split the index
 node:

 Left Index node   Right Index node      New Index node
 25 50               75 85                 60
After the record containing 95 is inserted.




Leaf nodes are at same level only.
B+ TREE – DELETION OPERATION

 Deleting a record from B+ tree may result in

 Case 1: If both the leaf node and index node does not
          go below the fill factor.

 Case 2: If the leaf node goes below fill factor and
          index node does not go below the fill factor.

 Case 3: If both the leaf node and index node goes
          below the fill factor.
DELETION –CASE 1
If both the leaf node and index node does not go below the fill
 factor.
Delete 70 from the following B+ Tree
   This node will contain 2 records after the deletion. So,
    simply delete 70 from the leaf node.
Delete 25 from the B+ tree

   when we delete 25 we must replace it with 28 in the index
    node.
DELETE 60 FROM THE B+ TREE

   The leaf node containing 60 will be below the fill factor
    after the deletion. Thus, we must combine leaf nodes.

   With recombined nodes, the index node will be reduced by
    one key. Hence, it will also fall below the fill factor. Thus,
    we must combine index nodes.

   60 appears as the only key in the root index node.
   After deleting 60
B+ TREES AS FILE INDEXES

 B+   Trees are descendants of B Trees.

 Retrieval  of records from large files or databases
  stored in external memory is time consuming.

 To  promote Efficient Retrievals, file indexes are
  used.

 An   index is a <Key , Address> pair.
 The records of the file are sequentially stored and for each
 block of records, the largest key and the block address is
 stored in an index.

 InB+ Tree to retrieve a record given its key, it is essential
 that the search traverses down to a leaf node to retrieve its
 address.

 The
    non leaf nodes only serve to help the process traverse
 downwards towards the appropriate leaf node.
ADVANTAGE OF B+ TREE
 B+   Trees are much easier and higher performing to
  do a full scan, since the terminal nodes form a linked
  list.
 But to do a full scan in B tree, a complete inorder
  traversal is to be made.

DISADVANTAGE OF B+ TREE
 Any  search will end at leaf node only.
 Time complexity for every search results in O(h).

              H-height of the B+ tree.
 Waste of Memory.

 In comparing to B+ trees, B trees are efficient.
THANK YOU

Más contenido relacionado

La actualidad más candente

B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 
Binary Heap Tree, Data Structure
Binary Heap Tree, Data Structure Binary Heap Tree, Data Structure
Binary Heap Tree, Data Structure Anand Ingle
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptSeethaDinesh
 
1.8 splay tree
1.8 splay tree 1.8 splay tree
1.8 splay tree Krish_ver2
 
Trees data structure
Trees data structureTrees data structure
Trees data structureSumit Gupta
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Treesagar yadav
 
non linear data structure -introduction of tree
non linear data structure -introduction of treenon linear data structure -introduction of tree
non linear data structure -introduction of treeSiddhi Viradiya
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Treekhabbab_h
 
B+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionB+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionHAMID-50
 
B+tree Data structures presentation
B+tree Data structures presentationB+tree Data structures presentation
B+tree Data structures presentationMuhammad Bilal Khan
 
THREADED BINARY TREE AND BINARY SEARCH TREE
THREADED BINARY TREE AND BINARY SEARCH TREETHREADED BINARY TREE AND BINARY SEARCH TREE
THREADED BINARY TREE AND BINARY SEARCH TREESiddhi Shrivas
 

La actualidad más candente (20)

Binary tree
Binary  treeBinary  tree
Binary tree
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Tree traversal techniques
Tree traversal techniquesTree traversal techniques
Tree traversal techniques
 
Binary Heap Tree, Data Structure
Binary Heap Tree, Data Structure Binary Heap Tree, Data Structure
Binary Heap Tree, Data Structure
 
Binary tree
Binary treeBinary tree
Binary tree
 
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)
 
BINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.pptBINARY TREE REPRESENTATION.ppt
BINARY TREE REPRESENTATION.ppt
 
1.8 splay tree
1.8 splay tree 1.8 splay tree
1.8 splay tree
 
Trees data structure
Trees data structureTrees data structure
Trees data structure
 
Linear Search Presentation
Linear Search PresentationLinear Search Presentation
Linear Search Presentation
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
non linear data structure -introduction of tree
non linear data structure -introduction of treenon linear data structure -introduction of tree
non linear data structure -introduction of tree
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
 
B+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletionB+ tree intro,uses,insertion and deletion
B+ tree intro,uses,insertion and deletion
 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and Dfs
 
B+tree Data structures presentation
B+tree Data structures presentationB+tree Data structures presentation
B+tree Data structures presentation
 
THREADED BINARY TREE AND BINARY SEARCH TREE
THREADED BINARY TREE AND BINARY SEARCH TREETHREADED BINARY TREE AND BINARY SEARCH TREE
THREADED BINARY TREE AND BINARY SEARCH TREE
 
Searching
SearchingSearching
Searching
 
Insertion sort algorithm power point presentation
Insertion  sort algorithm power point presentation Insertion  sort algorithm power point presentation
Insertion sort algorithm power point presentation
 
Extensible hashing
Extensible hashingExtensible hashing
Extensible hashing
 

Similar a B tree

Best for b trees
Best for b treesBest for b trees
Best for b treesDineshRaaja
 
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.pptssuser19bb13
 
Furnish an Index Using the Works of Tree Structures
Furnish an Index Using the Works of Tree StructuresFurnish an Index Using the Works of Tree Structures
Furnish an Index Using the Works of Tree Structuresijceronline
 
B TREE ( a to z concept ) in data structure or DBMS
B TREE ( a to z concept ) in data structure  or DBMSB TREE ( a to z concept ) in data structure  or DBMS
B TREE ( a to z concept ) in data structure or DBMSMathkeBhoot
 
Free video lectures for mba
Free video lectures for mbaFree video lectures for mba
Free video lectures for mbaEdhole.com
 
B trees and_b__trees
B trees and_b__treesB trees and_b__trees
B trees and_b__treesmeghu123
 
B-and-B-Tree-ppt presentation in data structure
B-and-B-Tree-ppt presentation in data structureB-and-B-Tree-ppt presentation in data structure
B-and-B-Tree-ppt presentation in data structuressuser19bb13
 
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.pptxMalligaarjunanN
 
Multiway Trees.ppt
Multiway Trees.pptMultiway Trees.ppt
Multiway Trees.pptAseemBhube1
 
Lecture 8 data structures and algorithms
Lecture 8 data structures and algorithmsLecture 8 data structures and algorithms
Lecture 8 data structures and algorithmsAakash deep Singhal
 

Similar a B tree (20)

Nikhat b+ trees ppt
Nikhat b+ trees pptNikhat b+ trees ppt
Nikhat b+ trees ppt
 
Jamal ppt b+tree dbms
Jamal ppt b+tree dbmsJamal ppt b+tree dbms
Jamal ppt b+tree dbms
 
B+tree
B+treeB+tree
B+tree
 
Best for b trees
Best for b treesBest for b trees
Best for b 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
 
B+ trees and height balance tree
B+ trees and height balance treeB+ trees and height balance tree
B+ trees and height balance tree
 
Furnish an Index Using the Works of Tree Structures
Furnish an Index Using the Works of Tree StructuresFurnish an Index Using the Works of Tree Structures
Furnish an Index Using the Works of Tree Structures
 
B TREE ( a to z concept ) in data structure or DBMS
B TREE ( a to z concept ) in data structure  or DBMSB TREE ( a to z concept ) in data structure  or DBMS
B TREE ( a to z concept ) in data structure or DBMS
 
Free video lectures for mba
Free video lectures for mbaFree video lectures for mba
Free video lectures for mba
 
B+ tree.pptx
B+ tree.pptxB+ tree.pptx
B+ tree.pptx
 
B trees and_b__trees
B trees and_b__treesB trees and_b__trees
B trees and_b__trees
 
B-and-B-Tree-ppt presentation in data structure
B-and-B-Tree-ppt presentation in data structureB-and-B-Tree-ppt presentation in data structure
B-and-B-Tree-ppt presentation in data structure
 
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
 
A41001011
A41001011A41001011
A41001011
 
Trees
TreesTrees
Trees
 
Multiway Trees.ppt
Multiway Trees.pptMultiway Trees.ppt
Multiway Trees.ppt
 
Data structure tree- advance
Data structure tree- advanceData structure tree- advance
Data structure tree- advance
 
Lecture 8 data structures and algorithms
Lecture 8 data structures and algorithmsLecture 8 data structures and algorithms
Lecture 8 data structures and algorithms
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 3.ppt
 
B+ tree
B+ treeB+ tree
B+ tree
 

Más de Tech_MX

Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimationTech_MX
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
String & its application
String & its applicationString & its application
String & its applicationTech_MX
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2Tech_MX
 
Stack data structure
Stack data structureStack data structure
Stack data structureTech_MX
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2Tech_MX
 
Set data structure
Set data structure Set data structure
Set data structure Tech_MX
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Tech_MX
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pcTech_MX
 
More on Lex
More on LexMore on Lex
More on LexTech_MX
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbmsTech_MX
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)Tech_MX
 
Memory dbms
Memory dbmsMemory dbms
Memory dbmsTech_MX
 

Más de Tech_MX (20)

Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Uid
UidUid
Uid
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimation
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
String & its application
String & its applicationString & its application
String & its application
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2
 
Stack data structure
Stack data structureStack data structure
Stack data structure
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Spss
SpssSpss
Spss
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
 
Set data structure
Set data structure Set data structure
Set data structure
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Parsing
ParsingParsing
Parsing
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pc
 
More on Lex
More on LexMore on Lex
More on Lex
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbms
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)
 
Memory dbms
Memory dbmsMemory dbms
Memory dbms
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

B tree

  • 2. INTRODUCTION A B+ tree is a balanced tree in which every path from the root of the tree to a leaf is of the same length, and each non leaf node of the tree has between [n/2] and [n] children, where n is fixed for a particular tree.  In a B+ tree, in contrast to a B-tree, all records are stored at the leaf level of the tree; only keys are stored in internal nodes.  All the leaf nodes are interconnected for faster access.  Fill factor is 50%.
  • 3. EXAMPLE  B+ Trees use a "fill factor" to control the growth and the shrinkage. A 50% fill factor would be the minimum for any B+. Example : A B+ tree of order 5.  Number of Keys 4  Number of Pointers 5  Fill Factor 50%  Minimum Keys in each node 2
  • 4. B+ TREE INTERNAL NODE / INDEX nodeS LEAF NODES / DATA nodeS The linked list allows rapid in-order traversal.
  • 5. OPERATIONS IN B+ TREE  SEARCH  INSERTION  DELETION
  • 6. B+ TREE- SEARCH OPERATION TWO CASES:  Successful Search  Unsuccessful Search
  • 7. SEARCHING  Compare the key value with the data in the tree, then give the result back. For example: find the value 45, and 15 in below tree.
  • 8. B+ TREE- INSERTION OPERATION Inserting a record when Case 1:If both leaf node and index node is not full. Case 2:If leaf node is full and index node is not full. Case 3:If both leaf node and index node is full.
  • 9. INSERTION –CASE 1 Add Record with Key 28
  • 10. INSERTION –CASE 2 Adding a record when the leaf node is full but the index node is not full. Add Record with Key 70
  • 11. • This record should go in the leaf node containing 50, 55, 60, and 65. Left Leaf node Right Leaf node 50 55 60 65 70 AFTER INSERTING A Record With Key 70.
  • 12. INSERTION –CASE 3 Adding a record when both the leaf node and the index node are full. Add a record containing a key value of 95 to the following tree.
  • 13. This record belongs in the node containing 75, 80, 85, and 90. Since this node is full we split it into two nodes: Left Leaf Node Right Leaf node 75 80 85 90 95 The middle key, 85, rises to the index node. But the index node is also full, so we split the index node: Left Index node Right Index node New Index node 25 50 75 85 60
  • 14. After the record containing 95 is inserted. Leaf nodes are at same level only.
  • 15. B+ TREE – DELETION OPERATION Deleting a record from B+ tree may result in Case 1: If both the leaf node and index node does not go below the fill factor. Case 2: If the leaf node goes below fill factor and index node does not go below the fill factor. Case 3: If both the leaf node and index node goes below the fill factor.
  • 16. DELETION –CASE 1 If both the leaf node and index node does not go below the fill factor. Delete 70 from the following B+ Tree
  • 17. This node will contain 2 records after the deletion. So, simply delete 70 from the leaf node.
  • 18. Delete 25 from the B+ tree  when we delete 25 we must replace it with 28 in the index node.
  • 19. DELETE 60 FROM THE B+ TREE  The leaf node containing 60 will be below the fill factor after the deletion. Thus, we must combine leaf nodes.  With recombined nodes, the index node will be reduced by one key. Hence, it will also fall below the fill factor. Thus, we must combine index nodes.  60 appears as the only key in the root index node.
  • 20. After deleting 60
  • 21. B+ TREES AS FILE INDEXES  B+ Trees are descendants of B Trees.  Retrieval of records from large files or databases stored in external memory is time consuming.  To promote Efficient Retrievals, file indexes are used.  An index is a <Key , Address> pair.
  • 22.  The records of the file are sequentially stored and for each block of records, the largest key and the block address is stored in an index.  InB+ Tree to retrieve a record given its key, it is essential that the search traverses down to a leaf node to retrieve its address.  The non leaf nodes only serve to help the process traverse downwards towards the appropriate leaf node.
  • 23. ADVANTAGE OF B+ TREE  B+ Trees are much easier and higher performing to do a full scan, since the terminal nodes form a linked list.  But to do a full scan in B tree, a complete inorder traversal is to be made. DISADVANTAGE OF B+ TREE  Any search will end at leaf node only.  Time complexity for every search results in O(h). H-height of the B+ tree.  Waste of Memory.  In comparing to B+ trees, B trees are efficient.