You are on page 1of 3

ITSA2003

Network Operating System and Configuration


Lab Tutorial - 9
Name: Rupesh Pandey
Student Id: 40290

Task:1
Consider a B+ tree in which the maximum number of keys in a node is 5. Calculate
what is the minimum order of keys in any non-root node?

ANS: Since the maximum number of keys is 5, maximum number of children


a node can have is 6. By definition of B Tree, minimum children that a node can
have would be 6/2 = 3. Therefore, minimum number of keys that a node can have
becomes 2 (3-1).

Task:2
Consider the following 2-3-4 tree, which means B-tree with a minimum degree of
two, in which each data item is a letter. The usual alphabetical ordering of letters is
used in constructing the tree. What will be the result of inserting G in the tree given
below:

L,P,U

B,H.I V,X,Z

N Q,T
Hint: To search a key in B tree, we start from root node and traverse until the key is
found or leaf node is reached. For searching a key in B+ tree, we start from root
node and traversed until leaf node is reached as every key is present in leaf nodes.

ANS:
Solution 1
A)

B)

C)
Solution 2

None
Since the given B tree has minimum degree as 2, the maximum degree or order will
be 2*2 = 4. Therefore, it will have at most 4 pointers or 3 keys.
We will traverse from root till leaf node where G is to be inserted. As G is less than L,
it will be inserted in leaf node with elements BHI. After insertion of G, the leaf node in
sorted order will be BGHI which leads to overflow. It will be split into two parts BG
and I and middle element H will be sent to its parent node as: 

Now root node with keys H, L, P, U is overflowed which leads to splitting of root node
into two parts HL and U and middle element P will be root node which matches
option B.
Note:
 There occur 2 splits for insertion of G.
 The height of B tree is 1 (path from root node to leaf node) before insertion of
G. After insertion of G, the height of B tree reaches 2.

You might also like