Question:

In a relational database, a B+ Tree Index is to be constructed for a relation on a key field. In a B+ Tree, a Node Pointer points to a sub-tree and a Data Record Pointer points to a block of database records.

Let, Node size = 4096 bytes, Node Pointer size = 10 bytes, Search Key Field size = 11 bytes and Data Record Pointer size = 12 bytes.

The maximum number of Node Pointers that can be present in a non-leaf node of the B+ Tree is __________. (Answer in integer)

Show Hint

A non-leaf node with n pointers holds n-1 keys between them; set up the space inequality and solve for the largest integer n.
Updated On: Jul 22, 2026
Show Solution
collegedunia
Verified By Collegedunia

Correct Answer: 195

Solution and Explanation

Step 1: Recall the structure of a non-leaf B+ Tree node.
A non-leaf node with \(n\) Node Pointers holds \(n\) pointers and \((n-1)\) search key values arranged between them (the keys are used to decide which pointer to follow). It does not store Data Record Pointers, those only appear in leaf nodes.

Step 2: Write the space constraint.
Total space used by \(n\) node pointers and \((n-1)\) keys must fit inside the node size:
\[ n \times (\text{Node Pointer size}) + (n-1) \times (\text{Search Key size}) \leq \text{Node size} \]
\[ n \times 10 + (n-1) \times 11 \leq 4096 \]

Step 3: Simplify the inequality.
\[ 10n + 11n - 11 \leq 4096 \]
\[ 21n \leq 4107 \]
\[ n \leq 195.57 \]

Step 4: Take the largest integer satisfying the constraint.
Since \(n\) must be a whole number, \(n = 195\).

Step 5: Verify by substitution.
For \(n = 195\): \(195 \times 10 + 194 \times 11 = 1950 + 2134 = 4084\) bytes, which fits within 4096 bytes.
For \(n = 196\): \(196 \times 10 + 195 \times 11 = 1960 + 2145 = 4105\) bytes, which exceeds 4096 bytes, so 196 pointers do not fit.

Final Answer:
The maximum number of Node Pointers in a non-leaf node is 195. \[ \boxed{195} \]
Was this answer helpful?
0
0

Top GATE DA Data Science and Artificial Intelligence Questions

View More Questions

Top GATE DA Database Management Systems Questions

View More Questions