SlideShare a Scribd company logo
1 of 14
B-tree


Presented by : Carlos Andrés González
                Castro
  San Buenaventura University – Cali
        Systems Engineering
               1105675
B-tree
 O B-tree is a balanced multiway search tree.
 O Emerged from the need to do a quick
   search of any content, without
   reorganizing the file.
Rules
 O Each tree node must have a minimum of n
   values ​at all times, except the root.
 O The maximum number of values ​that a
   node can have is 2 * n.
 O The tree is always balanced.
 O All leaf nodes belong together on the last
   level.
Search
 O Searching is similar to searching a binary
   search tree. Starting at the root, the tree is
   recursively traversed from top to bottom
 O If the key is not in the root and a leaf is
   reached, the key does not exist.
Insertion
 O All insertions start at a leaf node.
 O If the node contains fewer than the maximum
   legal number of elements, Insert the new
   element in the node, keeping the node's
   elements ordered.
 O If a leaf node is full, A single median is chosen
   from among the leaf's elements and the
   Values less than the median are put in the
   new left node and values greater than the
   median are put in the new right node, with the
   median acting as a separation value.
Inserción
 O The separation value is inserted in the
   node's parent, which may cause it to be
   split.
Deletion
 O Locate and delete the item, then
   restructure the tree to regain.
Types of deletion
 O Deletion from a leaf node: Search for the
  value to delete, If the value's in a leaf
  node, simply delete it from the node
Types of deletion
 O Deletion from an internal node: If the
  value is in an internal node, choose a new
  separator (either the largest element in
  the left subtree or the smallest element in
  the right subtree), remove it from the leaf
  node it is in, and replace the element to
  be deleted with the new separator.
Building a B-Tree
 O We wants to show how a B-tree grows in
   order 2 (n = 2).
 O The tree starts empty and we are going to
   enter 4 numbers (10,20,30,40).
 O First creates the root node and then add
   the 4 numbers.
Building a B-Tree
 O Now you want to insert the number 25.
 O Two child nodes are created and the
  median number goes to the root and the
  numbers less than the median pass to the
  node left child and the numbers older than
  the median to the right child node
Building a B-Tree
 O Now you want to insert the numbers
  5, 15 and 23.
Formando un Árbol B
 O As the root will have m = 2 values​​, it can
   not continue to having two son, now must
   have (m + 1) = 3 children.
Thanks

More Related Content

What's hot

Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
ghhgj jhgh
 

What's hot (20)

Binary search tree deletion
Binary search tree deletionBinary search tree deletion
Binary search tree deletion
 
B and B+ tree
B and B+ treeB and B+ tree
B and B+ tree
 
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
 
Trees
TreesTrees
Trees
 
Splay Tree
Splay TreeSplay Tree
Splay Tree
 
single linked list
single linked listsingle linked list
single linked list
 
Heap sort
Heap sortHeap sort
Heap sort
 
B trees and_b__trees
B trees and_b__treesB trees and_b__trees
B trees and_b__trees
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Binary search tree in data structures
Binary search tree in  data structuresBinary search tree in  data structures
Binary search tree in data structures
 
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
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 
B+tree Data structures presentation
B+tree Data structures presentationB+tree Data structures presentation
B+tree Data structures presentation
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Binary tree
Binary treeBinary tree
Binary tree
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structures
 
Binary search
Binary searchBinary search
Binary search
 
Tree and binary tree
Tree and binary treeTree and binary tree
Tree and binary tree
 
Data Structure (Tree)
Data Structure (Tree)Data Structure (Tree)
Data Structure (Tree)
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 

Similar to B-Tree

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
 

Similar to B-Tree (20)

Best for b trees
Best for b treesBest for b trees
Best for b trees
 
Tree.pptx
Tree.pptxTree.pptx
Tree.pptx
 
Search tree,Tree and binary tree and heap tree
Search tree,Tree  and binary tree and heap treeSearch tree,Tree  and binary tree and heap tree
Search tree,Tree and binary tree and heap tree
 
Unit 3.ppt
Unit 3.pptUnit 3.ppt
Unit 3.ppt
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
Trees in data structure
Trees in data structureTrees in data structure
Trees in data structure
 
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 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
 
TREES.pptx
TREES.pptxTREES.pptx
TREES.pptx
 
Balance tree. Short overview
Balance tree. Short overviewBalance tree. Short overview
Balance tree. Short overview
 
Lecture notes data structures tree
Lecture notes data structures   treeLecture notes data structures   tree
Lecture notes data structures tree
 
Binary tree
Binary tree Binary tree
Binary tree
 
Binary search tree.pptx
Binary search tree.pptxBinary search tree.pptx
Binary search tree.pptx
 
Trees
TreesTrees
Trees
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
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
 
Unit 6 tree
Unit   6 treeUnit   6 tree
Unit 6 tree
 
VCE Unit 05.pptx
VCE Unit 05.pptxVCE Unit 05.pptx
VCE Unit 05.pptx
 
Lecture 5 tree.pptx
Lecture 5 tree.pptxLecture 5 tree.pptx
Lecture 5 tree.pptx
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 

B-Tree

  • 1. B-tree Presented by : Carlos Andrés González Castro San Buenaventura University – Cali Systems Engineering 1105675
  • 2. B-tree O B-tree is a balanced multiway search tree. O Emerged from the need to do a quick search of any content, without reorganizing the file.
  • 3. Rules O Each tree node must have a minimum of n values ​at all times, except the root. O The maximum number of values ​that a node can have is 2 * n. O The tree is always balanced. O All leaf nodes belong together on the last level.
  • 4. Search O Searching is similar to searching a binary search tree. Starting at the root, the tree is recursively traversed from top to bottom O If the key is not in the root and a leaf is reached, the key does not exist.
  • 5. Insertion O All insertions start at a leaf node. O If the node contains fewer than the maximum legal number of elements, Insert the new element in the node, keeping the node's elements ordered. O If a leaf node is full, A single median is chosen from among the leaf's elements and the Values less than the median are put in the new left node and values greater than the median are put in the new right node, with the median acting as a separation value.
  • 6. Inserción O The separation value is inserted in the node's parent, which may cause it to be split.
  • 7. Deletion O Locate and delete the item, then restructure the tree to regain.
  • 8. Types of deletion O Deletion from a leaf node: Search for the value to delete, If the value's in a leaf node, simply delete it from the node
  • 9. Types of deletion O Deletion from an internal node: If the value is in an internal node, choose a new separator (either the largest element in the left subtree or the smallest element in the right subtree), remove it from the leaf node it is in, and replace the element to be deleted with the new separator.
  • 10. Building a B-Tree O We wants to show how a B-tree grows in order 2 (n = 2). O The tree starts empty and we are going to enter 4 numbers (10,20,30,40). O First creates the root node and then add the 4 numbers.
  • 11. Building a B-Tree O Now you want to insert the number 25. O Two child nodes are created and the median number goes to the root and the numbers less than the median pass to the node left child and the numbers older than the median to the right child node
  • 12. Building a B-Tree O Now you want to insert the numbers 5, 15 and 23.
  • 13. Formando un Árbol B O As the root will have m = 2 values​​, it can not continue to having two son, now must have (m + 1) = 3 children.