Consider the following \(B^+\) tree with 5 nodes, in which a node can store at…
2025
Consider the following \(B^+\) tree with 5 nodes, in which a node can store at most 3 key values. The value 23 is now inserted in the \(B^+\) tree. Which of the following options(s) is/are CORRECT?

- A.
None of the nodes will split.
- B.
At least one node will split and redistribute.
- C.
The total number of nodes will remain same.
- D.
The height of the tree will increase.
Attempted by 139 students.
Show answer & explanation
Correct answer: B, D
Solution:
Step-by-step reasoning for inserting 23 into the given B+ tree (maximum 3 keys per node):
Locate the leaf for 23: the rightmost leaf currently holds 20, 21, 22 (three keys).
Insert 23 into that leaf would produce four keys (20, 21, 22, 23), which exceeds the allowed maximum of three, so the leaf must split.
Typical split of the overflowed leaf yields two leaves with two keys each, for example [20, 21] and [22, 23]. In a B+ tree the first key of the new right leaf (22) is promoted to the parent as a separator.
Promoting 22 to the parent (the root) makes the root hold keys 6, 12, 19, 22 (four keys), which exceeds the maximum of three keys for an internal node, so the root must also split.
Splitting the root produces two internal nodes and a new root above them. Creating a new root increases the height of the tree by one.
Consequences (summary):
A leaf node splits (so it is false that no node will split).
Redistribution (borrowing keys from a sibling) is not possible here because neighboring leaves are full, so the action taken is splitting rather than redistribution.
The root splits and a new root is created, so the height increases by one.
The total number of nodes increases (example counts: start with 5 nodes; after leaf split -> 6; after root split -> 8).
Final evaluation of the given statements:
"None of the nodes will split." — Incorrect.
"At least one node will split and redistribute." — Incorrect (a split occurs but redistribution does not).
"The total number of nodes will remain same." — Incorrect (node count increases due to splits).
"The height of the tree will increase." — Correct.
A video solution is available for this question — log in and enroll to watch it.