Update README.md

B+ trees added with examples.
This commit is contained in:
NehaKeshan
2024-03-29 12:16:00 -04:00
committed by GitHub
parent a7e8637d47
commit 0332c4be5a

View File

@@ -30,8 +30,14 @@ modifications to the data structure:
What tree does our **ds_set** implementation produce if we insert the
numbers 1-14 **in order**?
 
 
 
 
 
 
The tree at the right is the result using a red-black tree. Notice how the tree is still quite balanced.
The tree at the top is the result using a red-black tree. Notice how the tree is still quite balanced.
Visit these links for an animation of the sequential insertion and re-balancing:
@@ -104,4 +110,17 @@ the rightmost child which has only keys ≥keyk1.
A B+ tree visualization can be seen at: https://www.cs.usfca.edu/~galles/visualization/BPlusTree.html
![alt text](BplusTrees.png "Bplus_Trees example")
Considerations in a full implementation:
- What happens when we want to add a key to a node that's already full?
- How do we remove values from a node?
- How do we ensure the tree stays balanced?
- How to keep laves linked together? WHy would we want this?
- How to represent key-value pairs?
## 21.5 Exercise
Draw a B+ tree with b=3 with values inserted in the order 1,2,3,4,5,6. Now draw a B+ tree with b=3 and values inserted in the order 6,5,4,3,2,1. The two trees have a different number of levels.