-1

I am trying to insert 3 4s into an empty B-tree. t = 3. I tried some applets online but all thay do is insert 4 once and then just drop 4. Is it the way it has been implemented in CLRS as I did not completely understand their pseudocode.

1 Answers1

0

When N has become 3 and you do the fourth insert, the root node has to be split, with at least N/2 nodes remaining in it and in each new leaf node. So the result must be a tree with 1 key in the root, and two leaves with 1 and 2 keys in them respectively, in either order depending on whether you regard a duplicate key as coming before or after the existing duplicates. Normally it would be after ...

user207421
  • 305,947
  • 44
  • 307
  • 483