ISRO 2018 · Indexing (B-trees, B+ trees, Hash Indexing)

MCQ · 1 mark · Problem DBMS-INDX-0017

in a file which contains 1 million records and the order of the tree is 100, then what is the maximum number of nodes to be accessed if B+ tree index is used?
  1. A
    5
  2. B
    4
  3. C
    3
  4. D
    10

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

Show the worked solutionThe search reads one node per level, so the maximum number of nodes accessed is the largest possible height. The tree is tallest when every node is as empty as allowed.\[\boxed{\text{order }p=100:\ \text{non-root nodes have}\ \ge 50\ \text{children (leaves}\ \ge 50\ \text{keys)},\ \text{root}\ \ge 2\ \text{children}}\]With \(h\) levels, the fewest records the tree can hold is \(2\cdot 50^{h-2}\cdot 50=2\cdot 50^{h-1}\):\[h=4:\ 2\cdot 50^{3}=250000\le 10^{6},\qquad h=5:\ 2\cdot 50^{4}=1.25\times10^{7}>10^{6}.\]So one million records fit in at most 4 levels, and a search touches at most 4 nodes.Answer: B

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