SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
 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

Contenu connexe

Tendances

Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data StructureDharita Chokshi
 
Free space managment46
Free space managment46Free space managment46
Free space managment46myrajendra
 
Heap and heapsort
Heap and heapsortHeap and heapsort
Heap and heapsortAmit Rathi
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structureSajid Marwat
 
Data Structure and Algorithms Hashing
Data Structure and Algorithms HashingData Structure and Algorithms Hashing
Data Structure and Algorithms HashingManishPrajapati78
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - GraphMadhu Bala
 
Insertion sort bubble sort selection sort
Insertion sort bubble sort  selection sortInsertion sort bubble sort  selection sort
Insertion sort bubble sort selection sortUmmar Hayat
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structuresDurgaDeviCbit
 
Dag representation of basic blocks
Dag representation of basic blocksDag representation of basic blocks
Dag representation of basic blocksJothi Lakshmi
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting AlgorithmsPranay Neema
 
3.9 external sorting
3.9 external sorting3.9 external sorting
3.9 external sortingKrish_ver2
 

Tendances (20)

AVL Tree in Data Structure
AVL Tree in Data Structure AVL Tree in Data Structure
AVL Tree in Data Structure
 
Tower of hanoi
Tower of hanoiTower of hanoi
Tower of hanoi
 
AVL Tree
AVL TreeAVL Tree
AVL Tree
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 
Free space managment46
Free space managment46Free space managment46
Free space managment46
 
Best,worst,average case .17581556 045
Best,worst,average case .17581556 045Best,worst,average case .17581556 045
Best,worst,average case .17581556 045
 
Heap and heapsort
Heap and heapsortHeap and heapsort
Heap and heapsort
 
Lec 17 heap data structure
Lec 17 heap data structureLec 17 heap data structure
Lec 17 heap data structure
 
Graph traversals in Data Structures
Graph traversals in Data StructuresGraph traversals in Data Structures
Graph traversals in Data Structures
 
Merge sort algorithm
Merge sort algorithmMerge sort algorithm
Merge sort algorithm
 
Data Structure and Algorithms Hashing
Data Structure and Algorithms HashingData Structure and Algorithms Hashing
Data Structure and Algorithms Hashing
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - Graph
 
Red black tree
Red black treeRed black tree
Red black tree
 
Insertion sort bubble sort selection sort
Insertion sort bubble sort  selection sortInsertion sort bubble sort  selection sort
Insertion sort bubble sort selection sort
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Linked List
Linked ListLinked List
Linked List
 
linked lists in data structures
linked lists in data structureslinked lists in data structures
linked lists in data structures
 
Dag representation of basic blocks
Dag representation of basic blocksDag representation of basic blocks
Dag representation of basic blocks
 
Sorting Algorithms
Sorting AlgorithmsSorting Algorithms
Sorting Algorithms
 
3.9 external sorting
3.9 external sorting3.9 external sorting
3.9 external sorting
 

En vedette

En vedette (20)

B-Tree
B-TreeB-Tree
B-Tree
 
B tree
B treeB tree
B tree
 
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
 
b+ tree
b+ treeb+ tree
b+ tree
 
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
 

Similaire à 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
 
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
 

Similaire à B tree (20)

2-3 trees in c++
2-3 trees in c++2-3 trees in c++
2-3 trees in c++
 
B tree
B  treeB  tree
B tree
 
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]
 
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
 

Plus de 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
 
the halting_problem
the halting_problemthe halting_problem
the halting_problemRajendran
 

Plus de 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
 
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
 
the halting_problem
the halting_problemthe halting_problem
the halting_problem
 

Dernier

How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationMJDuyan
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICESayali Powar
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxKatherine Villaluna
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17Celine George
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphNetziValdelomar1
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...Nguyen Thanh Tu Collection
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfYu Kanazawa / Osaka University
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17Celine George
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsEugene Lysak
 

Dernier (20)

How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
 
Quality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICEQuality Assurance_GOOD LABORATORY PRACTICE
Quality Assurance_GOOD LABORATORY PRACTICE
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptx
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17How to Use api.constrains ( ) in Odoo 17
How to Use api.constrains ( ) in Odoo 17
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a Paragraph
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
CHUYÊN ĐỀ DẠY THÊM TIẾNG ANH LỚP 11 - GLOBAL SUCCESS - NĂM HỌC 2023-2024 - HK...
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
 
Finals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quizFinals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quiz
 
How to Solve Singleton Error in the Odoo 17
How to Solve Singleton Error in the  Odoo 17How to Solve Singleton Error in the  Odoo 17
How to Solve Singleton Error in the Odoo 17
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
The Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George WellsThe Stolen Bacillus by Herbert George Wells
The Stolen Bacillus by Herbert George Wells
 

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

Notes de l'éditeur

  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.