GATE / CS ARCHIVE

GATE CSE 2017 SET 2 / QUESTION 49

GATE CSE 2017 Set 2 Q49

Data Structures · B-Trees & Multiway Search Trees · Full GATE CSE 2017 Set 2 paper

GATE 2017 Set 2, Q49 2 marks · NAT
Report issue

B-Trees & Multiway Search Trees

Question 49, GATE 2017: In a B+ tree, search keys occupy 8 bytes, blocks are 512 bytes, and block pointers occupy 2 bytes. What is the maximum order of the tree?
Tap to enlarge
Answer & solution

Official answer: 52.0

Our answer: 52

1. Use the conventional definition of order m as the maximum number of child pointers in an internal node. Such a node needs m pointers and m-1 separator keys, since keys separate adjacent child ranges.

2. The capacity inequality is 2m+8(m-1)≤512. Expanding gives 10m-8≤512, hence 10m≤520 and m≤52.

3. At m=52, the node uses 104 pointer bytes plus 408 key bytes, exactly 512. Increasing to 53 would require 522 bytes, so the maximum is 52. This is an internal-node calculation that ignores unspecified metadata; a different convention defining order as the number of keys must not be substituted silently.

Original paper, page 20 · Answer key