Question:

A node size is 4096B. Node pointer size is 10B. Search key is 11B. Record pointer is 12B. What is the Max node pointers that can be stored in a non-leaf node of a B+ tree?

Show Hint

Remember the structure of B+ tree nodes. Non-leaf nodes store keys and child pointers, while leaf nodes store keys and data/record pointers. For non-leaf node calculations, ignore the record pointer size. The relationship is always `m` pointers and `m-1` keys.
Updated On: Feb 23, 2026
Hide Solution
collegedunia
Verified By Collegedunia

Correct Answer: 195

Solution and Explanation

Step 1: Understanding the Question:
We need to determine the maximum order (maximum number of child pointers) of a non-leaf node in a B+ tree given the size of the node and the sizes of the keys and pointers. The record pointer size is only relevant for leaf nodes, not non-leaf nodes.
Step 2: Key Formula or Approach:
A non-leaf node in a B+ tree with an order of 'm' contains 'm' child pointers and 'm-1' search keys. The total size occupied by these pointers and keys must be less than or equal to the total node size.
Total Size = (m $\times$ size of a node pointer) + ((m-1) $\times$ size of a search key) $\le$ Node Size
Step 3: Detailed Explanation:
Let 'm' be the maximum number of node pointers (the order of the node).
Given:
- Node Size = 4096 Bytes
- Node pointer size = 10 Bytes
- Search key size = 11 Bytes
We set up the inequality based on the structure of a non-leaf node: \[ (m \times 10) + ((m-1) \times 11) \le 4096 \] Now, we solve for m: \[ 10m + 11m - 11 \le 4096 \] \[ 21m - 11 \le 4096 \] \[ 21m \le 4096 + 11 \] \[ 21m \le 4107 \] \[ m \le \frac{4107}{21} \] \[ m \le 195.571... \] Step 4: Final Answer:
Since the number of pointers 'm' must be an integer, we take the floor of the result. The maximum integer value for m is 195. Therefore, the maximum number of node pointers is 195.
Was this answer helpful?
0
0

Top Questions on Data Structures and Algorithms

View More Questions

Questions Asked in GATE DA exam

View More Questions