GATE / CS ARCHIVE

GATE CSE 2010 / QUESTION 18

Minimum nonroot B+ tree keys

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 2010 paper

GATE 2010, Q18 1 mark · MCQ
Report issue

Indexing, Storage & Query Processing

Question 18, GATE 2010: In a B+ tree, the maximum number of keys in a node is five. What is the minimum number of keys in any nonroot node?
Options: (A) 1; (B) 2; (C) 3; (D) 4.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

With at most five keys, an internal node has at most six child pointers. A nonroot internal node must have at least ceil(6/2)=3 children and therefore at least two separator keys. Such an internal node attains the minimum, giving 2, B. Under the usual leaf convention a leaf with capacity five has at least three data keys; the requested minimum over nonroot nodes is still two, not a claim that every leaf may have two.

An internal search node with c child pointers has c−1 separator keys. The maximum of five keys therefore corresponds to order six, whose half-full lower bound is three children, not three keys. The root is exempt from the ordinary minimum occupancy rule. Keeping child counts distinct from key counts avoids the common off-by-one error.

Original paper, page 4