GATE / CS ARCHIVE

GATE CSE 1999 / QUESTION 21

Bound records stored at B-tree leaves

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

GATE 1999, Q21 5 marks · Descriptive
Report issue

B-Trees & Multiway Search Trees

Question 21, GATE 1999: In a B-tree, every non-root internal node has between m and 2m−1 children inclusive. The root is at level 0; all leaves are at level h≥1. Derive minimum and maximum numbers of records in the leaf nodes.
Tap to enlarge
Answer & solution

Answer: Under standard B-tree key occupancy: minimum 2m^(h−1)(m−1); maximum (2m−1)^h(2m−2). (no official key was published)

State the usual B-tree assumptions explicitly: m≥2, an internal node with c children has c−1 records, the non-leaf root has 2 through 2m−1 children, and non-root leaves carry between m−1 and 2m−2 records. The printed child bound alone does not independently specify leaf capacity; these are the conventional B-tree occupancy rules, not B+ tree rules or the alternative maximum-2m convention.
For the minimum, choose two root children and m children at every internal level below the root. The number of leaves is then Lmin=2mh−1: for h=1 there are two leaves; each further level multiplies their count by m. Filling each leaf with m−1 records gives Rmin=2mh−1(m−1).
For the maximum, root and all other internal nodes have 2m−1 children, so Lmax=(2m−1)h. Filling every leaf with 2m−2 records gives Rmax=(2m−1)h(2m−2). Both bounds are attained by uniformly minimally or maximally occupied levels.
These counts exclude records in internal nodes. For example m=2,h=1 gives 2 to 6 leaf records (2 leaves×1 up to 3 leaves×2), not the 3 to 8 total records including the root. If only the literal internal-child bound is permitted without standard leaf-occupancy rules, leaf record counts are underdetermined; only the leaf-node bounds follow with the usual root rule.

Original paper, page 9