CS FundamentalsVery hardGATE CS · PSU (ISRO/BARC)

Keys 47, 46, 27, 42, 22, 7, 58, 45, 48, 51 are inserted in this order into an empty B+ tree where a node holds at most 3 keys; an overflowing leaf with 4 keys keeps the first 2 and moves the rest to a new right leaf, copying the new leaf's first key up; an overflowing internal node with 4 keys keeps the first 2, moves the next key up and puts the rest in a new right node. After all insertions, how many leaf nodes are there and what is the height (number of levels)?

  1. A. 3 leaves, height 2
  2. B. 4 leaves, height 3
  3. C. 5 leaves, height 2
  4. D. 4 leaves, height 2

Correct answer: D. 4 leaves, height 2

Simulating the splits gives leaves 7,22 | 27,42,45 | 46,47 | 48,51,58 and root keys [27, 46, 48], so 4 leaves at height 2.

More DBMS and SQL questions

Exams that ask this topic