SlideShare a Scribd company logo
1 of 23
 Large degree B-trees used to represent very large
dictionaries that reside on disk.
 Smaller degree B-trees used for internal-memory
dictionaries to overcome cache-miss penalties.
 Definition assumes external nodes (extended
m-way search tree).
 B-tree of order m.
◦ m-way search tree.
◦ Not empty => root has at least 2 children.
◦ Remaining internal nodes (if any) have at least
ceil(m/2) children.
◦ External (or failure) nodes on same level.
 B-tree of order m.
◦ m-way search tree.
◦ Not empty => root has at least 2 children.
◦ Remaining internal nodes (if any) have at least
ceil(m/2) children.
◦ External (or failure) nodes on same level.
• 2-3 tree is B-tree of order 3.
• 2-3-4 tree is B-tree of order 4.
 B-tree of order m.
◦ m-way search tree.
◦ Not empty => root has at least 2 children.
◦ Remaining internal nodes (if any) have at least
ceil(m/2) children.
◦ External (or failure) nodes on same level.
• B-tree of order 5 is 3-4-5 tree (root may be
2-node though).
• B-tree of order 2 is full binary tree.
 n = # of pairs.
 # of external nodes = n + 1.
 Height = h => external nodes on level h + 1.
1 1
2 >= 2
3 >= 2*ceil(m/2)
h + 1 >= 2*ceil(m/2)h-1
n + 1 >= 2*ceil(m/2)h-1
, h >= 1
level # of nodes
 m = 200.
n + 1 >= 2*ceil(m/2)h-1
, h >= 1
height # of pairs
2 >= 199
3 >= 19,999
4 >= 2 * 106
–1
5 >= 2 * 108
–1
h <= log ceil(m/2) [(n+1)/2] + 1
 Worst-case search time.
◦ (time to fetch a node + time to search node) * height
◦ (a + b*m + c * log2m) * h
where a, b and c are constants.
m
search
time
50 400
15 20
8
4
1 3 5 6 30 409
Insertion into a full leaf triggers bottom-up node
splitting pass.
16 17
 ai is a pointer to a subtree.
 pi is a dictionary pair.
m a0 p1 a1 p2 a2 …pm am
ceil(m/2)-1 a0 p1 a1 p2 a2 …pceil(m/2)-1 aceil(m/2)-1
m-ceil(m/2) aceil(m/2) pceil(m/2)+1 aceil(m/2)+1 …pm am
• pceil(m/2) plus pointer to new node is inserted in
parent.
15 20
8
4
1 3 5 6 30 409
• Insert a pair with key = 2.
• New pair goes into a 3-node.
16 17
 Insert new pair so that the 3 keys are in
ascending order.
• Split overflowed node around middle key.
1 2 3
• Insert middle key and pointer to new node
into parent.
1 3
2
15 20
8
4
1 3 5 6 30 409
• Insert a pair with key = 2.
16 17
15 20
8
4
5 6 30 409 16 17
3
1
2
• Insert a pair with key = 2 plus a pointer into parent.
• Now, insert a pair with key = 18.
15 20
8
1
2 4
5 6 30 409 16 173
 Insert new pair so that the 3 keys are in
ascending order.
• Split the overflowed node.
16 17 18
• Insert middle key and pointer to new node
into parent.
1816
17
• Insert a pair with key = 18.
15 20
8
1
2 4
5 6 30 409 16 173
• Insert a pair with key = 17 plus a pointer into parent.
15 20
8
1
2 4
5 6 30 4093
18
16
17
• Insert a pair with key = 17 plus a pointer into parent.
8
1
2 4
5 6 30 4093 16
17
15
18
20
• Now, insert a pair with key = 7.
1
2 4
5 6 30 4093 16
15
18
20
8 17
• Insert a pair with key = 6 plus a pointer into parent.
30 401
2 4
93 16
15
18
20
8 17
5
7
6
• Insert a pair with key = 4 plus a pointer into parent.
30 401 93 16
15
18
20
8 17
6
4
2
5 7
• Insert a pair with key = 8 plus a pointer into parent.
• There is no parent. So, create a new root.
30 40
1
9
3
16
15
18
20
6
8
2
5 7
4
17
• Height increases by 1.
30 401 93 16
15
18
2062
5 7
4 17
8

More Related Content

What's hot (20)

Threaded Binary Tree.pptx
Threaded Binary Tree.pptxThreaded Binary Tree.pptx
Threaded Binary Tree.pptx
 
Multi ways trees
Multi ways treesMulti ways trees
Multi ways trees
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 
B trees
B treesB trees
B trees
 
B trees dbms
B trees dbmsB trees dbms
B trees dbms
 
B tree
B  treeB  tree
B tree
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
DATA STRUCTURES unit 4.pptx
DATA STRUCTURES unit 4.pptxDATA STRUCTURES unit 4.pptx
DATA STRUCTURES unit 4.pptx
 
Red black trees
Red black treesRed black trees
Red black trees
 
10.m way search tree
10.m way search tree10.m way search tree
10.m way search tree
 
Priority Queue in Data Structure
Priority Queue in Data StructurePriority Queue in Data Structure
Priority Queue in Data Structure
 
1.5 binary search tree
1.5 binary search tree1.5 binary search tree
1.5 binary search tree
 
Linked List
Linked ListLinked List
Linked List
 
Graph representation
Graph representationGraph representation
Graph representation
 
B-Tree
B-TreeB-Tree
B-Tree
 
AVL Tree
AVL TreeAVL Tree
AVL Tree
 
Non Linear Data Structures
Non Linear Data StructuresNon Linear Data Structures
Non Linear Data Structures
 
Linked list
Linked listLinked list
Linked list
 
Double Linked List (Algorithm)
Double Linked List (Algorithm)Double Linked List (Algorithm)
Double Linked List (Algorithm)
 

Viewers also liked

BTree, Data Structures
BTree, Data StructuresBTree, Data Structures
BTree, Data StructuresJibrael Jos
 
Best for b trees
Best for b treesBest for b trees
Best for b treesDineshRaaja
 
Algorithm Introduction #18 B-Tree
Algorithm Introduction #18 B-TreeAlgorithm Introduction #18 B-Tree
Algorithm Introduction #18 B-TreeSatoshi Asano
 
B trees and_b__trees
B trees and_b__treesB trees and_b__trees
B trees and_b__treesmeghu123
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMSkoolkampus
 
stack and queue array implementation in java.
stack and queue array implementation in java.stack and queue array implementation in java.
stack and queue array implementation in java.CIIT Atd.
 
Algebra 1 2.8 Algebraic Proof
Algebra 1 2.8 Algebraic ProofAlgebra 1 2.8 Algebraic Proof
Algebra 1 2.8 Algebraic ProofJaqueline Vallejo
 
Insertion in RED BLACK TREE
Insertion in RED BLACK TREEInsertion in RED BLACK TREE
Insertion in RED BLACK TREEnikhilarora2211
 
Struktur data 06 (red black tree)
Struktur data 06 (red black tree)Struktur data 06 (red black tree)
Struktur data 06 (red black tree)Sunarya Marwah
 
TRIES_data_structure
TRIES_data_structureTRIES_data_structure
TRIES_data_structureddewithaman10
 
Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)Adam Mukharil Bachtiar
 

Viewers also liked (20)

B Trees
B TreesB Trees
B Trees
 
BTree, Data Structures
BTree, Data StructuresBTree, Data Structures
BTree, Data Structures
 
Best for b trees
Best for b treesBest for b trees
Best for b trees
 
B trees and_b__trees
B trees and_b__treesB trees and_b__trees
B trees and_b__trees
 
Algorithm Introduction #18 B-Tree
Algorithm Introduction #18 B-TreeAlgorithm Introduction #18 B-Tree
Algorithm Introduction #18 B-Tree
 
B trees and_b__trees
B trees and_b__treesB trees and_b__trees
B trees and_b__trees
 
B tree &amp;
B tree &amp;B tree &amp;
B tree &amp;
 
B tree long
B tree longB tree long
B tree long
 
12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS12. Indexing and Hashing in DBMS
12. Indexing and Hashing in DBMS
 
stack and queue array implementation in java.
stack and queue array implementation in java.stack and queue array implementation in java.
stack and queue array implementation in java.
 
B tree short
B tree shortB tree short
B tree short
 
Algebra 1 2.8 Algebraic Proof
Algebra 1 2.8 Algebraic ProofAlgebra 1 2.8 Algebraic Proof
Algebra 1 2.8 Algebraic Proof
 
Insertion in RED BLACK TREE
Insertion in RED BLACK TREEInsertion in RED BLACK TREE
Insertion in RED BLACK TREE
 
Struktur data 06 (red black tree)
Struktur data 06 (red black tree)Struktur data 06 (red black tree)
Struktur data 06 (red black tree)
 
Logic gates with laws
Logic gates with lawsLogic gates with laws
Logic gates with laws
 
Red black trees presentation
Red black trees presentationRed black trees presentation
Red black trees presentation
 
10 Red-Black Trees
10 Red-Black Trees10 Red-Black Trees
10 Red-Black Trees
 
Red black trees1109
Red black trees1109Red black trees1109
Red black trees1109
 
TRIES_data_structure
TRIES_data_structureTRIES_data_structure
TRIES_data_structure
 
Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)
 

Similar to B tree

LEC 7-DS ALGO(expression and huffman).pdf
LEC 7-DS  ALGO(expression and huffman).pdfLEC 7-DS  ALGO(expression and huffman).pdf
LEC 7-DS ALGO(expression and huffman).pdfMuhammadUmerIhtisham
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search TreeAdityaK92
 
BTrees-fall2010.ppt
BTrees-fall2010.pptBTrees-fall2010.ppt
BTrees-fall2010.pptzalanmvb
 
B tree by-jash acharya
B tree by-jash acharyaB tree by-jash acharya
B tree by-jash acharyaJash Acharya
 
btrees.ppt ttttttttttttttttttttttttttttt
btrees.ppt  tttttttttttttttttttttttttttttbtrees.ppt  ttttttttttttttttttttttttttttt
btrees.ppt tttttttttttttttttttttttttttttRAtna29
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree methodRajendran
 
Optimal Binary Search tree ppt seminar.pptx
Optimal Binary Search tree ppt seminar.pptxOptimal Binary Search tree ppt seminar.pptx
Optimal Binary Search tree ppt seminar.pptxssusered44c8
 
Completing the square if a
Completing the square if aCompleting the square if a
Completing the square if aMartinGeraldine
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structuresKàŕtheek Jåvvàjí
 
Presentation on b trees [autosaved]
Presentation on b trees [autosaved]Presentation on b trees [autosaved]
Presentation on b trees [autosaved]AKASHKUMAR1542
 
NameInstructor1. Find the interval(s) where i.docx
NameInstructor1. Find the interval(s) where  i.docxNameInstructor1. Find the interval(s) where  i.docx
NameInstructor1. Find the interval(s) where i.docxrosemarybdodson23141
 
lecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminologylecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminologyKamranAli649587
 

Similar to B tree (20)

2-3 trees in c++
2-3 trees in c++2-3 trees in c++
2-3 trees in c++
 
4 1, 4 2
4 1, 4 24 1, 4 2
4 1, 4 2
 
08 B Trees
08 B Trees08 B Trees
08 B Trees
 
LEC 7-DS ALGO(expression and huffman).pdf
LEC 7-DS  ALGO(expression and huffman).pdfLEC 7-DS  ALGO(expression and huffman).pdf
LEC 7-DS ALGO(expression and huffman).pdf
 
Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
BTrees-fall2010.ppt
BTrees-fall2010.pptBTrees-fall2010.ppt
BTrees-fall2010.ppt
 
2.pptx
2.pptx2.pptx
2.pptx
 
B tree by-jash acharya
B tree by-jash acharyaB tree by-jash acharya
B tree by-jash acharya
 
btrees.ppt ttttttttttttttttttttttttttttt
btrees.ppt  tttttttttttttttttttttttttttttbtrees.ppt  ttttttttttttttttttttttttttttt
btrees.ppt ttttttttttttttttttttttttttttt
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
B trees
B treesB trees
B trees
 
Optimal Binary Search tree ppt seminar.pptx
Optimal Binary Search tree ppt seminar.pptxOptimal Binary Search tree ppt seminar.pptx
Optimal Binary Search tree ppt seminar.pptx
 
Chapter 4.1 and 4.2
Chapter 4.1 and 4.2Chapter 4.1 and 4.2
Chapter 4.1 and 4.2
 
Completing the square if a
Completing the square if aCompleting the square if a
Completing the square if a
 
Branch and bounding : Data structures
Branch and bounding : Data structuresBranch and bounding : Data structures
Branch and bounding : Data structures
 
Presentation on b trees [autosaved]
Presentation on b trees [autosaved]Presentation on b trees [autosaved]
Presentation on b trees [autosaved]
 
NameInstructor1. Find the interval(s) where i.docx
NameInstructor1. Find the interval(s) where  i.docxNameInstructor1. Find the interval(s) where  i.docx
NameInstructor1. Find the interval(s) where i.docx
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
 
Rumus matematik examonline spa
Rumus matematik examonline spaRumus matematik examonline spa
Rumus matematik examonline spa
 
lecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminologylecture10 date structure types of graph and terminology
lecture10 date structure types of graph and terminology
 

More from Rajendran

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower boundsRajendran
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsRajendran
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower boundsRajendran
 
Red black tree
Red black treeRed black tree
Red black treeRajendran
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statisticsRajendran
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theoremRajendran
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theoremRajendran
 
Master method
Master method Master method
Master method Rajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
Master method theorem
Master method theoremMaster method theorem
Master method theoremRajendran
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithmsRajendran
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisRajendran
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisRajendran
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of QuicksortRajendran
 
Np completeness
Np completenessNp completeness
Np completenessRajendran
 
computer languages
computer languagescomputer languages
computer languagesRajendran
 
proving non-computability
proving non-computabilityproving non-computability
proving non-computabilityRajendran
 

More from Rajendran (20)

Element distinctness lower bounds
Element distinctness lower boundsElement distinctness lower bounds
Element distinctness lower bounds
 
Scheduling with Startup and Holding Costs
Scheduling with Startup and Holding CostsScheduling with Startup and Holding Costs
Scheduling with Startup and Holding Costs
 
Divide and conquer surfing lower bounds
Divide and conquer  surfing lower boundsDivide and conquer  surfing lower bounds
Divide and conquer surfing lower bounds
 
Red black tree
Red black treeRed black tree
Red black tree
 
Hash table
Hash tableHash table
Hash table
 
Medians and order statistics
Medians and order statisticsMedians and order statistics
Medians and order statistics
 
Proof master theorem
Proof master theoremProof master theorem
Proof master theorem
 
Recurrence theorem
Recurrence theoremRecurrence theorem
Recurrence theorem
 
Master method
Master method Master method
Master method
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Hash tables
Hash tablesHash tables
Hash tables
 
Lower bound
Lower boundLower bound
Lower bound
 
Master method theorem
Master method theoremMaster method theorem
Master method theorem
 
Greedy algorithms
Greedy algorithmsGreedy algorithms
Greedy algorithms
 
Longest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm AnalysisLongest common subsequences in Algorithm Analysis
Longest common subsequences in Algorithm Analysis
 
Dynamic programming in Algorithm Analysis
Dynamic programming in Algorithm AnalysisDynamic programming in Algorithm Analysis
Dynamic programming in Algorithm Analysis
 
Average case Analysis of Quicksort
Average case Analysis of QuicksortAverage case Analysis of Quicksort
Average case Analysis of Quicksort
 
Np completeness
Np completenessNp completeness
Np completeness
 
computer languages
computer languagescomputer languages
computer languages
 
proving non-computability
proving non-computabilityproving non-computability
proving non-computability
 

Recently uploaded

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
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.pptxMaritesTamaniVerdade
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
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-701bronxfugly43
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
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).pptxVishalSingh1417
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 

Recently uploaded (20)

Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
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
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
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
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 

B tree

  • 1.  Large degree B-trees used to represent very large dictionaries that reside on disk.  Smaller degree B-trees used for internal-memory dictionaries to overcome cache-miss penalties.
  • 2.  Definition assumes external nodes (extended m-way search tree).  B-tree of order m. ◦ m-way search tree. ◦ Not empty => root has at least 2 children. ◦ Remaining internal nodes (if any) have at least ceil(m/2) children. ◦ External (or failure) nodes on same level.
  • 3.  B-tree of order m. ◦ m-way search tree. ◦ Not empty => root has at least 2 children. ◦ Remaining internal nodes (if any) have at least ceil(m/2) children. ◦ External (or failure) nodes on same level. • 2-3 tree is B-tree of order 3. • 2-3-4 tree is B-tree of order 4.
  • 4.  B-tree of order m. ◦ m-way search tree. ◦ Not empty => root has at least 2 children. ◦ Remaining internal nodes (if any) have at least ceil(m/2) children. ◦ External (or failure) nodes on same level. • B-tree of order 5 is 3-4-5 tree (root may be 2-node though). • B-tree of order 2 is full binary tree.
  • 5.  n = # of pairs.  # of external nodes = n + 1.  Height = h => external nodes on level h + 1. 1 1 2 >= 2 3 >= 2*ceil(m/2) h + 1 >= 2*ceil(m/2)h-1 n + 1 >= 2*ceil(m/2)h-1 , h >= 1 level # of nodes
  • 6.  m = 200. n + 1 >= 2*ceil(m/2)h-1 , h >= 1 height # of pairs 2 >= 199 3 >= 19,999 4 >= 2 * 106 –1 5 >= 2 * 108 –1 h <= log ceil(m/2) [(n+1)/2] + 1
  • 7.  Worst-case search time. ◦ (time to fetch a node + time to search node) * height ◦ (a + b*m + c * log2m) * h where a, b and c are constants. m search time 50 400
  • 8. 15 20 8 4 1 3 5 6 30 409 Insertion into a full leaf triggers bottom-up node splitting pass. 16 17
  • 9.  ai is a pointer to a subtree.  pi is a dictionary pair. m a0 p1 a1 p2 a2 …pm am ceil(m/2)-1 a0 p1 a1 p2 a2 …pceil(m/2)-1 aceil(m/2)-1 m-ceil(m/2) aceil(m/2) pceil(m/2)+1 aceil(m/2)+1 …pm am • pceil(m/2) plus pointer to new node is inserted in parent.
  • 10. 15 20 8 4 1 3 5 6 30 409 • Insert a pair with key = 2. • New pair goes into a 3-node. 16 17
  • 11.  Insert new pair so that the 3 keys are in ascending order. • Split overflowed node around middle key. 1 2 3 • Insert middle key and pointer to new node into parent. 1 3 2
  • 12. 15 20 8 4 1 3 5 6 30 409 • Insert a pair with key = 2. 16 17
  • 13. 15 20 8 4 5 6 30 409 16 17 3 1 2 • Insert a pair with key = 2 plus a pointer into parent.
  • 14. • Now, insert a pair with key = 18. 15 20 8 1 2 4 5 6 30 409 16 173
  • 15.  Insert new pair so that the 3 keys are in ascending order. • Split the overflowed node. 16 17 18 • Insert middle key and pointer to new node into parent. 1816 17
  • 16. • Insert a pair with key = 18. 15 20 8 1 2 4 5 6 30 409 16 173
  • 17. • Insert a pair with key = 17 plus a pointer into parent. 15 20 8 1 2 4 5 6 30 4093 18 16 17
  • 18. • Insert a pair with key = 17 plus a pointer into parent. 8 1 2 4 5 6 30 4093 16 17 15 18 20
  • 19. • Now, insert a pair with key = 7. 1 2 4 5 6 30 4093 16 15 18 20 8 17
  • 20. • Insert a pair with key = 6 plus a pointer into parent. 30 401 2 4 93 16 15 18 20 8 17 5 7 6
  • 21. • Insert a pair with key = 4 plus a pointer into parent. 30 401 93 16 15 18 20 8 17 6 4 2 5 7
  • 22. • Insert a pair with key = 8 plus a pointer into parent. • There is no parent. So, create a new root. 30 40 1 9 3 16 15 18 20 6 8 2 5 7 4 17
  • 23. • Height increases by 1. 30 401 93 16 15 18 2062 5 7 4 17 8

Editor's Notes

  1. May also be used internally to reduce cache misses and hence improve performance.
  2. Alternative definition has pairs only in leaves; remaining nodes have keys only. Leaf-pushed B-tree or B+-tree.
  3. Not possible for an internal node in an extended tree to have only 1 child.
  4. Typically pick m so as to fill a block.
  5. 2-3 Tree. Insert 10, no problem. Insert 18?
  6. Node Splitting
  7. The code will do all 3 steps as one.