What will this B-tree look like?

The B-tree is of order 4, which means that a node can contain 4 pointers and 3 keys.

The following is inserted: AG i Y

Since they cannot fit into a single node, I know that the node will be split. So I know that after these things are inserted, there will be a root node with 2 child nodes, but I don’t know exactly what they will look like.

+3
source share
2 answers
A

A inserted

AG

G inserted

AGI

I inserted

  G
 / \
A   I

On insertion, the Y node is filled, split into 2 nodes, and runs in the middle, G

  G
 / \
A   IY

Y inserted

+3
source

Source: https://habr.com/ru/post/1739914/


All Articles