GATE / CS ARCHIVE

GATE CSE 2008 / QUESTION 41

Maximum splits in an order-four B-tree

Data Structures · B-Trees & Multiway Search Trees · Full GATE CSE 2008 paper

GATE 2008, Q41 2 marks · MCQ
Report issue

B-Trees & Multiway Search Trees

Question 41, GATE 2008: A B-tree of order 4 is built from empty by ten successive insertions. What is the maximum number of node-splitting operations?

(A) 3
(B) 4
(C) 5
(D) 6
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. An order-four B-tree has at most three keys per node. The maximum is five splits. For ordinary overflow-triggered insertion, inserting 1 through 10 in ascending order and promoting the lower middle key splits a leaf on insertions 4, 6, 8 and 10; the fourth leaf split also overflows and splits the root. For a timing-independent bound, after L leaf splits there are L+1 nonempty leaves. A B-tree with L+1 leaves has exactly L separator keys in all internal nodes combined: each internal node has one fewer key than children, and summing over the tree gives leaves minus one.
2. Consequently n≥(L+1)+L=2L+1. With n=10, L≤4. Under overflow-triggered insertion, the first internal split needs the root to receive four separators from four leaf splits. With no further leaf split possible, no second internal split can occur. Thus there is at most one internal/root split and the total is at most 4+1=5.
3. Under preemptive splitting, the full root may instead split after three leaf splits, distributing its three separators into a new root with one key and two internal children with one key each. At most one further leaf split is possible, which can increase only one such child to two keys; no internal node can become full again. The same upper bound therefore holds, and increasing-key insertion attains five splits under this convention too.

Original paper, page 7