In a database file structure, the search key field is 9 bytes long, the block…

2006

In a database file structure, the search key field is 9 bytes long, the block size is 512 bytes, a record pointer is 7 bytes and a block pointer is 6 bytes. The largest possible order of a non-leaf node in a B+ tree implementing this file structure is

  1. A.

    23

  2. B.

    24

  3. C.

    34

  4. D.

    44

Attempted by 80 students.

Show answer & explanation

Correct answer: C

Given:

  • Search key size = 9 bytes

  • Block pointer size = 6 bytes

  • Block size = 512 bytes

For a non-leaf (internal) node with m pointers, the node stores m block pointers and m−1 keys. Therefore the space constraint is:

m × 6 + (m − 1) × 9 ≤ 512

Solve the inequality:

  • m×6 + (m−1)×9 ≤ 512 ⇒ 6m + 9m − 9 ≤ 512 ⇒ 15m − 9 ≤ 512

  • 15m ≤ 521 ⇒ m ≤ 521/15 ≈ 34.733…

  • m must be an integer, so the largest possible order is 34.

Answer: 34

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir