GATE / CS ARCHIVE

GATE CSE 2025 SET 2 / QUESTION 57

GATE CSE 2025 Set 2 Q57

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 2025 Set 2 paper

GATE 2025 Set 2, Q57 2 marks · NAT
Report issue

Indexing, Storage & Query Processing

Question 57, GATE 2025: A B+ tree node holds at most four keys. One root-to-leaf path is A=(49,77,83,−), B=(7,19,33,44), C=(20*,22*,25*,26*), where stars mark leaf data entries. A pointer between separators k1,k2 covers [k1,k2), and a newly created leaf copies its smallest key into its parent. Insert key 23. What is the smallest separator key in the parent of the resulting leaf that contains 25*?
Tap to enlarge
Answer & solution

Official answer: 33

The insertion belongs in C because 19≤23<33. Its sorted data entries become [20*,22*,23*,25*,26*], exceeding the four-key limit, so C splits. With a 2/3 split, the leaves are [20*,22*] and [23*,25*,26*], and separator 23 is copied up. With a 3/2 split, they are [20*,22*,23*] and [25*,26*], and separator 25 is copied up. Let k be that copied separator, either 23 or 25.

B was already full. After receiving k, its ordered separators are [7,19,k,33,44], so B must split as well. For an internal-node split, the middle separator k is promoted to A rather than kept as a key in either split internal node. The left internal node retains [7,19], and the right retains [33,44]. The leaf holding 25* is on the right side of k and is a child of this right internal node.

Consequently its parent's smallest stored key is 33, even though that parent has a leftmost child whose values can be smaller than 33. A had spare capacity, so receiving k causes no further split. The unspecified 2/3 versus 3/2 leaf convention does not change the requested answer: 33.

Original paper, page 43 · Answer key