Question:hard

Consider a B+ Tree where the maximum number of key values in each leaf node is 2 and the maximum number of pointers in each non-leaf node is 3. Let the content of the B+ Tree be as shown in the figure.



Which of the following options denotes the key value(s) stored in the root node after inserting a key value 3 in the given B+ Tree?

Show Hint

First find which leaf 3 falls into using the \(\le\) rule on the root separators, then check the leaf split, and finally check if the root itself now has too many pointers and must split too.
Updated On: Jul 22, 2026
  • 5
  • 8
  • 3 and 5
  • 3, 5 and 8
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Restate the split rules before touching the tree.
A leaf here can hold at most 2 keys, so a 3rd key forces a leaf split. An internal node can hold at most 2 keys (since it can carry at most 3 child pointers), so a 3rd key at that level forces the node to split too, with its middle key promoted upward instead of being copied.

Step 2: Locate the target leaf for key 3.
The root separators are 5 and 8. Using the ordering already visible from the leaves, the leftmost child [1, 5] is the one whose largest stored key is 5, so any key at or below 5, including 3, lands there.

Step 3: Grow the leaf and split it.
[1, 5] plus the new key 3 gives the ordered list [1, 3, 5]. Splitting an odd list of 3 into two leaves of size 2 and 1 gives [1, 3] on the left and [5] on the right.
The separator carried up to the parent for this new pair is the boundary value 3, the last key of the left half.

Step 4: Count pointers at the root before deciding if it overflows.
The root started with exactly 3 children (its allowed maximum). Inserting the new separator 3 would raise the child count to 4 pointers with keys [3, 5, 8], one pointer past the limit, so the root must be split next.

Step 5: Promote the middle key of the overflowed root.
List the three root keys in order: 3, 5, 8. The middle entry is 5. In an internal-node split this middle entry alone becomes the new root, while 3 stays with the left half and 8 stays with the right half; neither child keeps a copy of 5.

Conclusion:
The tree now has a new single-key root: 5. That is choice (A).\[ \boxed{5} \]
Was this answer helpful?
0