GATE / CS ARCHIVE

GATE CSE 2000 / QUESTION 21(a)(i)

Draw B-plus tree after six inserts

Database Management Systems · Indexing, Storage & Query Processing · Full GATE CSE 2000 paper

GATE 2000, Q21(a)(i) Descriptive
Report issue

Indexing, Storage & Query Processing

Question 21(a)(i), GATE 2000: An initially empty B+-tree allows up to 5 keys per leaf and up to 5 separator keys per internal node. Insert distinct keys in increasing order. Use standard overflow splitting: a sixth leaf key yields two 3-key leaves, and copy the right leaf minimum into the parent; leaf data keys stay in leaves. Show the tree after inserting 1 through 6, without intermediate diagrams.
Question 21(a)(i), GATE 2000: An initially empty B+-tree allows up to 5 keys per leaf and up to 5 separator keys per internal node. Insert distinct keys in increasing order. Use standard overflow splitting: a sixth leaf key yields two 3-key leaves, and copy the right leaf minimum into the parent; leaf data keys stay in leaves. Show the tree after inserting 1 through 6, without intermediate diagrams.
Question 21(a)(i), GATE 2000: An initially empty B+-tree allows up to 5 keys per leaf and up to 5 separator keys per internal node. Insert distinct keys in increasing order. Use standard overflow splitting: a sixth leaf key yields two 3-key leaves, and copy the right leaf minimum into the parent; leaf data keys stay in leaves. Show the tree after inserting 1 through 6, without intermediate diagrams.
Tap to enlarge
Answer & solution

Answer: Root [4]; linked leaves [1,2,3] → [4,5,6]. (no official key was published)

The requested final tree is:
             [4]
            /   ╲
     [1 2 3] → [4 5 6]

The first five keys fit in the single root-leaf. Inserting 6 overflows its capacity to six keys, so divide its sorted entries evenly into [1,2,3] and [4,5,6]. Create an internal root with separator 4, the minimum of the right child. A search for a key below 4 chooses the left child and a search for 4 or greater chooses the right. Because this is a B+-tree, copying 4 to the parent does not remove 4 from the leaf. The arrow denotes the leaf-level successor link. The stem does not define its separator convention; a max-left convention can instead display root[3] with the same leaves. Here and in subsequent parts the minimum-of-right convention is fixed explicitly.

Original paper, page 10