GATE CS 2008 · SQL Queries

MCQ · 2 marks · Problem DBMS-SQL-0299

A B-tree of order 4 is built from scratch by 10 successive insertions. What is the maximum number of node splitting operations that may take place?
  1. A
    3
  2. B
    4
  3. C
    5
  4. D
    6

Solve it on GATE DA practice →More Relational Model & SQL problems

Show the worked solutionOrder 4: a node holds at most 3 keys, and inserting a 4th key splits it (one key moves up). A split of the root also creates a new root.To maximise splits, insert so that every split leaves nodes as empty as possible, e.g. in increasing order 1, 2, ..., 10:• key 4 splits the root leaf (split 1); keys 6 and 8 each split the rightmost leaf (splits 2, 3), giving a root with 3 keys; • key 10 splits the rightmost leaf (split 4), the root overflows and splits too (split 5), creating a new root.An exhaustive search over all insertion orders confirms that no order of 10 keys causes more than 5 splits.Answer: C

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