Consider the following data for B-tree and B+ tree,

Block size is  8 KB,  
Data pointer is 10 B,  
Block pointer is of 15 B and 
key size is 10 B 

Calculate the difference of maximum order of leaf node of B-tree (P) and maximum order of leaf node of B+ tree (Q)?

(A) 210
(B) 195
(C) -175
(D) None of these.


Answer: (C)

Explanation: Given,

Block size = 8 KB,  
Data pointer or record pointer = Rp = 10 byte
Block pointer or child pointer = Bp = 15 byte
Key size/pointer = Kp = 10 byte 

Since, maximum order (P) of leaf node of B tree is given by formula:

P(Bp) + (P-1)*(Kp + Rp) ≤ Block size
P(15) + (P-1)*(10+10) ≤    8 KB
15P + 20P - 20 ≤ 8*1024
35P ≤ 8192+20
35P ≤ 8212
35P ≤ 8212/35
P ≤ 234.63
P = 234 

Take floor value for maximum.

And, maximum order (Q) of leaf node of B+ tree is given by formula:

(Q-1)*(Kp + Rp) + (Bp) ≤ Block size
(Q-1)*(10+10) + 15 ≤ 8 KB
20Q - 20 + 15 ≤ 8*1024
20Q - 5 ≤ 8192
20Q ≤ 8192+5
Q ≤ 8197/20
Q ≤ 409.85
Q = 409 

Take floor value for maximum.

Therefore P – Q = 234 – 409 = -175
So, option (C) is correct.


Quiz of this Question


  • Last Updated : 30 Oct, 2018

Share your thoughts in the comments