B plus Tree · Data Structures
9 questions · asked in 7 of 27 years (2000–2026)
MCQ 6 · MSQ 1 · NAT 21-mark 7 · 2-mark 2
Questions 6–9 of 9
Answer: (B)
Any non-root node needs at least children. So the least number of keys is 3 1 = 2.
Answer: 2
10, 3, 6, 8, 4, 2, 1
The maximum number of times leaf nodes would get split up as a result of these insertions is
Answer: (C)
Insert 10, 3: leaf [3, 10].
Insert 6: [3, 6, 10] overflows. Leaf split 1: [3, 6] and [10]. Root [6].
Insert 8: goes right, [8, 10].
Insert 4: goes left, [3, 4, 6] overflows. Leaf split 2: [3, 4] and [6]. Root [4, 6].
Insert 2: goes to [3, 4], giving [2, 3, 4]. Leaf split 3: [2, 3] and [4]. The key 3 goes up, so the root [3, 4, 6] has too many keys and splits (an internal split, not a leaf split). The key 4 moves up to a new root [4], over the internal nodes [3] and [6].
Insert 1: goes to [2, 3], giving [1, 2, 3]. Leaf split 4: [1, 2] and [3]. The key 2 joins the internal node [3], which becomes [2, 3] and has room.
So the leaves split 4 times. Splitting the other way ([3, 6, 10] into [3] and [6, 10]) gives fewer: any mix of the two ways gives 3 or 4. The maximum is 4.
Answer: (C)
Keys K15 and then K25 are inserted into this tree in that order. Now the key K50 is deleted from the tree resulting after the two insertions made earlier. Consider the following statements about the tree resulting after this deletion.
i. The height of the tree remains the same.
ii. The node
(disregarding the links) is present in the tree.
iii. The root node remains unchanged (disregarding the links).
Which one of the following options is true ?
Answer: (A)
Insert K15: it goes to leaf [K10, K20], which becomes K10, K15, K20 (3 keys, but at most 2 are allowed). It splits into [K10] and [K15, K20], and K15 is copied up into the parent [K30], which becomes [K15, K30].
Insert K25: it goes to leaf [K15, K20] (K25 lies between K15 and K30), which splits into [K15] and [K20, K25]. K20 goes up, so the parent has K15, K20, K30 and splits too. K20 moves up to the root, which becomes [K20, K40]. The tree after both insertions is below. The circled nodes are the ones changed when K50 is deleted.
Delete K50: the leaf [K50] becomes empty. Its sibling leaf [K40] has only 1 key, the minimum, so it cannot lend one. The two leaves merge into [K40]. The parent node [K50] is left with one child and no key. The next figure shows this middle state, with [K40] hanging directly below the root, one level too high.
That internal node is too small, so it merges with its sibling [K30], which has only 2 children and cannot lend one. K40 comes down from the root, and the merged node is [K30, K40] with leaves [K20, K25], [K30], [K40]. The root loses K40 and becomes [K20]. This last step is a merge, not a redistribution.
(i) Height: the original tree and the final tree both have root, internal nodes and leaves, so the height is the same. True.
(ii) The node with the single key K20 is the new root. True.
(iii) The root was [K40] at the start, and is [K20] at the end. It changed. False.
Answer: (A)
Keys K15 and then K25 are inserted into this tree in that order. Exactly how many of the following nodes (disregarding the links) will be present in the tree after the two insertions?
Answer: (A)
Each node has at most two keys and three links. A leaf holds at most 2 keys; an overflow splits the leaf and copies the first key of the new right leaf up into the parent.
Insert first. It goes to the leaf , which is full. The leaf splits into and , and K15 is copied up. The parent becomes , which still fits. The tree becomes:
Next, insert . It lies between K15 and K30, so it goes to the leaf , which is full. That leaf splits into and , and K20 is copied up. The parent would now hold , which is too many, so it splits as well: K20 moves up into the root, leaving and . The root becomes . The tree becomes:
The listed nodes are , , and . In the final tree, only is present (the leaf existed after the first insertion but was split by the second). So exactly 1 of them is present.
Answer: (A)
Keep practising