1

In my database class, my professor was describing about deleting keys from the B+ Tree. If you see the below image:

enter image description here

enter image description here

I totally understood everything except one part where he told that the leaf level nodes can only contain 3 keys at most. As my per my understanding, depending upon the depth of B+ tree, the total keys are decided at the leaf level varies from d to 2*d where d is the depth of tree. Since here d for leaf is 2, why can't the leaf level nodes have 4 keys. Where I am going wrong?

The total number of keys contained at the root level also matter here? Could anyone please explain

python
  • 4,403
  • 13
  • 56
  • 103

1 Answers1

1

I totally understood everything except one part where he told that the leaf level nodes can only contain 3 keys at most.

If he really said that, he's wrong. It is 4, same as the order of the B+-tree. His own picture proves it: see the bottom right-hand node.

As my per my understanding, depending upon the depth of B+ tree, the total keys are decided at the leaf level varies from d to 2*d where d is the depth of tree

Totally wrong. The depth of the tree has nothing to do with it. The number of keys per node is between N/2 and N, except in the root node which can have fewer.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • Simple and very effective. Thank you sir :) – python Dec 08 '15 at 03:54
  • How did you calculated order of a B+ tree here? Is it number of elements in the root, for example here the number of elements is `4`. – python Dec 08 '15 at 03:59
  • 1
    @python You *don't* calculate it. You *specify* it, in your design. The order of a tree is the maximum number of elements that can exist in a node, by design. – user207421 Dec 08 '15 at 04:12