Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What will this B-tree look like?

Tags:

b-tree

The B-tree is of order 4, meaning that a node can hold 4 pointers, and 3 keys.

The following is inserted: A G I Y

Since they can't all fit in one node, I know that the node will split. So I know there's going to be a root node with 2 child nodes after these things are inserted, but I don't know exactly what they'll look like.

like image 829
neuromancer Avatar asked Nov 23 '25 12:11

neuromancer


1 Answers

A

A is inserted

AG

G is inserted

AGI

I is inserted

  G
 / \
A   I

While inserting Y the node is full, split into 2 nodes and pass up the middle, G

  G
 / \
A   IY

Y is inserted

like image 62
Corey Avatar answered Nov 27 '25 01:11

Corey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!