The -marked keys signify that these are data entries in a leaf.
Assume that a pointer between keys and points to a subtree containing keys in , and that when a leaf is created, the smallest key in it is copied up into its parent.
A record with key value is inserted into the - tree.
The smallest key value in the parent of the leaf that contains is __________. (Answer in integer)
View worked solution
Answer: 33:33
To insert the key , we first traverse the -tree along the given path:
- From root , since , we follow the first pointer to node .
- From , since , we follow the pointer between and to leaf node .
Since leaf is full (maximum capacity of 4 keys), inserting causes a split of the keys . Depending on the split policy, we have two standard cases:
Case 1: Left-biased split (2 keys left, 3 keys right)
- Left leaf:
- Right leaf:
- The smallest key in the right leaf, , is copied up to parent .
Case 2: Right-biased split (3 keys left, 2 keys right)
- Left leaf:
- Right leaf:
- The smallest key in the right leaf, , is copied up to parent .
In both cases, the leaf containing is , and the key copied up to the parent is .
Now, parent is also full. Inserting into results in the key set , causing to split:
- The middle key is pushed up to root .
- splits into left node and right node .
The right leaf (containing ) is pointed to by the leftmost child pointer of the newly created right internal node . Thus, the parent of the leaf containing is .
The smallest key value in is 33.
Free practice · Your answers on this page are not saved.
