What are B-Trees?
B-Trees are balanced search trees designed to work well on disks or other storage devices.
They are similar to Red-Black Trees, but they are better at minimizing disk I/O operations.
A B-tree T is a rooted tree (whose root is T.root) having the following properties:
What is the difference between B-Trees and Red-Black Trees?
B-Trees can have any number of child nodes, hence the branching factor is much larger
How are new keys inserted into a B-tree?
Inserting a key into a B-tree is significantly more complicated than inserting a key into a binary search tree. As with binary search trees, we search for the leaf position at which to insert the new key. With a B-tree, however, we cannot simply create a new leaf node and insert it, as the resulting tree would fail to be a valid B-tree.
Instead, we insert the new key into an existing leaf node. Since we cannot insert a key into a leaf node that is full, we introduce an operation that splits a full node y (having 2t-1 keys) around its median key y.key_t into tow nodes having only t-1 keys each. The median key moves up into y’s parent to identify the dividing point between the two new trees.