Data Structures & AlgorithmsVery hardGATE CS · Advanced

Keys 10, 20, 30, 40, 50, 60, 70, 80, 15, 25, 35, 45 are inserted in this order into an empty B-tree of minimum degree t = 2 (every node holds 1 to 3 keys), using the proactive method: while descending, every full node (3 keys) met on the way is split first, and a full root is split before inserting. How many node splits happen in total?

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

Correct answer: C. 4

Simulate the descent: each time a full node (3 keys) is met on the way down it is split before moving on, and a full root adds a level. Counting every such split over the 12 insertions gives 4.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic