GATE DA 2026 · Indexing (B-trees, B+ trees, Hash Indexing)

MCQ · 2 marks · Problem DBMS-INDX-0011

Consider a B+ tree in which a leaf node holds at most \(2\) key values and a non-leaf node holds at most \(3\) pointers. The tree has a root holding the keys \(5\) and \(8\), and three leaves which hold, from left to right, \(\{1, 5\}\), \(\{7, 8\}\) and \(\{9, 12\}\). (A key equal to a separator is kept in the subtree to its left: the first leaf holds keys \(\le 5\), the second keys in \((5, 8]\) and the third keys \(> 8\).)Which of the following options denotes the key value(s) stored in the root node after inserting the key value \(3\) into this B+ tree?
  1. A
    5
  2. B
    8
  3. C
    3 and 5
  4. D
    3, 5 and 8

Solve it on GATE DA practice →More Storage & Indexing problems

Show the worked solution\[\boxed{\text{leaf overflow: split and copy a separator up;}\ \ \text{internal overflow: split and push the middle key up}}\]Insert \(3\): since \(3 \le 5\) it goes to the leaf \(\{1, 5\}\), which overflows to \(\{1, 3, 5\}\). It splits into \(\{1, 3\}\) and \(\{5\}\), and the separator \(3\) is copied up into the root.The root now holds \(\{3, 5, 8\}\) with \(4\) child pointers, one more than the maximum of \(3\), so it splits as well: its middle key \(5\) is pushed up into a new root, and the old root becomes two internal nodes \(\{3\}\) and \(\{8\}\).The new root holds only the key \(5\) (whichever way the full leaf is split, the three separators are \(\{s, 5, 8\}\) with \(s < 5\), so the middle one is \(5\)).Answer: A

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com