GATE / CS ARCHIVE

GATE CSE 1997 / QUESTION 19(c)

Minimize B+-tree leaf count

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

GATE 1997, Q19(c) 2 marks · Descriptive
Report issue

Indexing, Storage & Query Processing

Question 19(c), GATE 1997: In this question a B+-tree of order d has d to 2d key entries in each nonroot internal node, and an internal node with M keys has M+1 children. An internal root has 1 to 2d keys. All leaves are at equal edge-distance h from the root. Use this stated convention, not the alternative convention that “order” means maximum fan-out. For h≥1, find the minimum number of leaves.
Question 19(c), GATE 1997: In this question a B+-tree of order d has d to 2d key entries in each nonroot internal node, and an internal node with M keys has M+1 children. An internal root has 1 to 2d keys. All leaves are at equal edge-distance h from the root. Use this stated convention, not the alternative convention that “order” means maximum fan-out. For h≥1, find the minimum number of leaves.
Question 19(c), GATE 1997: In this question a B+-tree of order d has d to 2d key entries in each nonroot internal node, and an internal node with M keys has M+1 children. An internal root has 1 to 2d keys. All leaves are at equal edge-distance h from the root. Use this stated convention, not the alternative convention that “order” means maximum fan-out. For h≥1, find the minimum number of leaves.
Tap to enlarge
Answer & solution

Answer: 2(d+1)^(h−1). (no official key was published)

Since h≥1, the root is internal. Its minimum one key gives a minimum of two children. Every other internal node has at least d keys, hence at least d+1 children.

At depth 1 there are therefore at least 2 nodes. At depth 2 there are at least 2(d+1), and continuing to the leaf level h gives

minimum leaves = 2(d+1)h−1.

The exponent is h−1 because the first branching step is performed by the root, with minimum fan-out two; the remaining h−1 steps have minimum fan-out d+1. Multiplying by d rather than d+1 would confuse the minimum number of keys with the number of child pointers.

The bound is attainable: give the root exactly two children and every other internal node exactly d+1 children, stopping with leaves at depth h. All nonroot internal nodes then have exactly d keys, the root has exactly one, and every leaf lies at the required common depth. For h=1 the tree is a root with two leaf children, and the formula gives 2. For d=4,h=3 it gives 2·5²=50 leaves, consistent with the 52-leaf construction in the companion part. A tree of height zero is outside this subpart and would instead consist of a single leaf.

Original paper, page 9