Skip to content
Related Articles
GATE | Quiz for Sudo GATE 2021 | Question 3
• Last Updated : 14 Dec, 2020

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 ```

Which of the following option is correct ?

Note – This question is multiple select questions (MSQ).
(A) Maximum order of leaf node of B-tree is 230
(B) Maximum order of leaf node of B+ tree (Q) is 405
(C) Difference of maximum order of leaf node of B-tree (P) and maximum order of leaf node of B+ tree (Q) -175
(D) All of these are correct.

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, only option (C) is correct.

Quiz of this Question
Please comment below if you find anything wrong in the above post

Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up