in Databases edited by
6,826 views
31 votes
31 votes

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. $23$
  2. $24$
  3. $34$
  4. $44$
in Databases edited by
6.8k views

3 Answers

39 votes
39 votes
Best answer

Answer is (C).

From the structure of $B+$ tree we can get this equation:

$n\times p + (n-1)\times k \leq B$ ( for non leaf node)

Here, n=order, p=tree/block/index pointer,  B=size of block

I non leaf node no record pointer is there in B+ tree.

So, $n\times p + (n-1)k \leq B$

$n\times 6 + (n-1)\times 9 \leq 512$

$\implies n \leq 34.77$

Largest possible value for $n$ is $34.$

edited by

4 Comments

So, still max number of key values at the leaf node and order of internal nodes don’t have any relationship. I mean they need not be equal always. If the order is equal to 34 for internal node then the max number of search key values can be greater than or equal to 34. Please correct me if I am wrong. @adad20 @ayush.5.

0
0

@ankit3009 Yes in B+ trees order of leaf and order of internal nodes are different. In internal node order defines max number of children it can have while in leaf order means max #key and record pointer pairs it can have.

2
2

Thanks @adad20 and @ayush.5 :)

2
2
4 votes
4 votes

option C

Because in non leaf node of the B+ tree there is not any record pointer 

so formula will be  n*p + (n-1)*(k) <= B ( for non leaf node) 

put the values and get the answer k=9 and  p=6 and B=512 

so answer is 34

–7 votes
–7 votes
option B) 24

2 Comments

how plz explain
0
0

this is correct answer in the case of they are asking for leaf but they are asking for non-leaf so 24 is wrong

1
1
Answer:

Related questions