Data Structures & AlgorithmsVery hardGATE CS

A B-tree has minimum degree t = 3 (every non-root node has between 2 and 5 keys) and height 3 (a root-only tree has height 0). What are the minimum and maximum numbers of keys it can hold?

  1. A. 54 and 1295
  2. B. 53 and 1295
  3. C. 53 and 1080
  4. D. 80 and 1295

Correct answer: B. 53 and 1295

Minimum: root with 1 key and 2 children, then 3 children per node, each node holding 2 keys: 1 + 2(t − 1)(1 + t + … + t^2) = 2t^3 − 1 = 53. Maximum: every node full with 2t children: (2t)^4 − 1 = 1295.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic