Skip to content
Official PYQ · 2007

GATE CS 2007 Q63 — File Organization and Indexing (B and B+ Trees)

Explain with AI

The order of a leaf node in a B+B^+ - tree is the maximum number of (value, data record pointer) pairs it can hold. Given that the block size is 1K  bytes1K\;\text{bytes}, data record pointer is 7  bytes7\;\text{bytes} long, the value field is 9  bytes9\;\text{bytes} long and a block pointer is 6  bytes6 \;\text{bytes} long, what is the order of the leaf node?

Choose one option
View worked solution

Answer: A

To find the order of the leaf node in the B+B^+-tree, we first understand its structure.

According to the definition given in the question, the order pp of a leaf node is the maximum number of (value, data record pointer) pairs it can hold. In addition to these pairs, a leaf node in a B+B^+-tree also contains a block pointer to point to the next leaf node (for sequential access).

Let:

  • pp = Order of the leaf node (number of key-pointer pairs)
  • VV = Size of the value (key) field = 9 bytes9\text{ bytes}
  • RR = Size of the data record pointer = 7 bytes7\text{ bytes}
  • PP = Size of the block pointer (next-leaf pointer) = 6 bytes6\text{ bytes}
  • BB = Block size = 1 KB=1024 bytes1\text{ KB} = 1024\text{ bytes}

The total space occupied by the leaf node must not exceed the block size:

p×(V+R)+P≤Bp \times (V + R) + P \le B

Substitute the given values into the inequality:

p×(9+7)+6≤1024p \times (9 + 7) + 6 \le 1024 16p+6≤102416p + 6 \le 1024 16p≤101816p \le 1018 p≤101816≈63.625p \le \frac{1018}{16} \approx 63.625

Since the order pp must be an integer, the maximum possible value of pp is ⌊63.625⌋=63\lfloor 63.625 \rfloor = 63.

Therefore, the order of the leaf node is 63.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore File Organization and Indexing (B and B+ Trees) questions