CS FundamentalsVery hardGATE CS

A B+ tree is built so that every node is completely full: a leaf holds 100 keys and an internal node has 101 children. It indexes 1,000,000 distinct keys. How many levels (root to leaf, both counted) does the tree have?

  1. A. 2
  2. B. 3
  3. C. 4
  4. D. 5

Correct answer: B. 3

Leaves: 1,000,000 / 100 = 10,000. Their parents: ceil(10,000 / 101) = 100 nodes. Those need ceil(100 / 101) = 1 root. That is 3 levels.

More DBMS and SQL questions

Exams that ask this topic