Explain B+ tree show the growth of b+ tree of order 5 by inserting the following keys show each steps 10,5,3,7,6,4,37,11,13,15,67,53,12,16,2 show the status after deleting 11
Answers
Type 1. Based on order and number of keys in B and B+ tree –
These are the few key points related to order and number of keys:
A B/B+ tree with order p has maximum p pointers and hence maximum p children.
A B/B+ tree with order p has minimum ceil(p/2) pointers and hence minimum ceil(p/2) children.
A B/B+ tree with order p has maximum (p – 1) and minimum ceil(p/2) – 1 keys.
Que – 1. Consider a B+-tree in which the maximum number of keys in a node is 5. What is the minimum number of keys in any non-root node? (GATE CS 2010)
(A) 1
(B) 2
(C) 3
(D) 4
Solution: Assuming order of B+ tree as p, maximum number of keys will be (p – 1). As it is given that,
p – 1 = 5 => p = 6
Therefore, minimum number of keys:
ceil(p/2) – 1 = 2
Type 2. Based on inserting a key in B/B+ tree –
Given the order of B/B+ tree and keys to be inserted, it can be asked to find resultant B/B+ tree or height of B/B+ tree.
Que – 2. Consider the following 2-3-4 tree (i.e., 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.