• edited by
26,061 views
67 67 votes

Consider the $B^+$ tree in the adjoining figure, where each node has at most two keys and three links.

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?

  1. $1$
  2. $2$
  3. $3$
  4. $4$

5 Answers

Best answer
78 78 votes

Option (A) is correct.

It is a $B^+$ Tree.

After inserting $K15$ we get

 

Now, we insert $K25$, which gives -

So, we see in the final tree only $\text{(K20, K25)}$ is present. Hence, 1 (Ans).

• edited by
14 14 votes
Answer: A

Only one node will be there, i.e. (K 20,K 25). After inserting K 15, the node (K 10, K 20) splits and K 15 moves up to form (K 15,K 30).

After K 25 is inserted, K20 moves up to the root  & splits up (K15,K30) &  it forms (K 20,K 25).

So, after final insertion only (K20,K25) present.  So, 1 is the answer.
1 1 vote
I am not adding complete answer but just adding some useful points

In B+ tree unlike B tree in case of overflow we keep value in leaf as well as promote value to parent node

For intermediate nodes operation is same for both B and B++ i..e promote value to parent node don't keep value in child node

In case of left Biasing : when in case of overflow no of keys are odd , take middle key with left sibling

In case of right Biasing : when in case of overflow no of keys are odd , take middle key with right sibling

follow only one biasing for all splits in tree , dont change method in between.  hence answer is (20,25) in either left biasing or right one.
–3 –3 votes
1 node will be there (15,20)
• edited by
Answer:
Position:
Show:

Related questions

61 61 votes
5 answers 5 answers
35.9k
35.9k views
Ishrat Jahan asked Oct 30, 2014
35,934 views
Consider the $B^{+}$ tree in the adjoining figure, where each node has at most two keys and three links.Keys $K15$ and then $K25$ are inserted into this tree in that orde...
89 89 votes
5 answers 5 answers
22.7k
22.7k views
Ishrat Jahan asked Oct 30, 2014
22,703 views
Consider the following relation schemas :b-Schema = (b-name, b-city, assets)a-Schema = (a-num, b-name, bal)d-Schema = (c-name, a-number)Let branch, account and depositor ...
60 60 votes
9 answers 9 answers
23.4k
23.4k views
Ishrat Jahan asked Oct 30, 2014
23,354 views
Consider the following implications relating to functional and multivalued dependencies given below, which may or may not be correct.if $A \rightarrow \rightarrow B$ and ...
72 72 votes
8 answers 8 answers
29.6k
29.6k views
Ishrat Jahan asked Oct 30, 2014
29,593 views
Consider the following two transactions$: T1$ and $T2.$$\begin{array}{clcl} T1: & \text{read (A);} & T2: & \text{read (B);} \\ & \text{read (B);} & & \text{read (A);} \\ ...