Download presentation
Presentation is loading. Please wait.
1
Indexing (cont.)
2
Insertion in a B+ Tree 80 20306070100120140 1015181920256065808590 10151820253040606580859019 Another B+ Tree 50 304050
3
Insertion in a B+ Tree 80 20306070100120140 1015181920256065808590 10151820253040606580859019 Now Insert 12 50 304050
4
Insertion in a B+ Tree 80 20306070100120140 2025 20253040 Need to split leaf 50 3040501012151819 1012151819
5
Insertion in a B+ Tree 80 100120140 2025 20253040 Need to split branch 50 304050 1012151819 1520306070 1012151819
6
Insertion in a B+ Tree 3080 100120140 2025 20253040 After split 50 304050 1012151819 1012151819 15206070
7
Deleting a Data Entry from a B+ Tree Start at root, find leaf L where entry belongs. Remove the entry. –If L is at least half-full, done! –If L has only d-1 entries, Try to re-distribute, borrowing from sibling (adjacent node with same parent as L). If re-distribution fails, merge L and sibling. If merge occurred, must delete entry (pointing to L or sibling) from parent of L. Merge could propagate to root, decreasing height.
8
Deletion from a B+ Tree 80 203060100120140 1015181920256065808590 10151820253040606580859019 Delete 30 50 304050
9
Deletion from a B+ Tree 80 203060100120140 1015181920256065808590 101518202540606580859019 After deleting 30 50 4050 May change to 40, or not
10
Deletion from a B+ Tree 80 203060100120140 1015181920256065808590 101518202540606580859019 Now delete 25 50 4050
11
Deletion from a B+ Tree 80 203060100120140 10151819206065808590 1015182040606580859019 After deleting 25 Need to rebalance Rotate 50 4050
12
Deletion from a B+ Tree 80 193060100120140 10151819206065808590 1015182040606580859019 Now delete 40 50 4050
13
Deletion from a B+ Tree 80 193060100120140 10151819206065808590 10151820606580859019 After deleting 40 Rotation not possible Need to merge nodes 50
14
Deletion from a B+ Tree 80 1960100120140 1015181920506065808590 10151820606580859019 Final tree 50
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.