1 1 vote Assume block size 4096 bytes,size of key is 4 bytes,size of pointer is 8 bytes.How many keys are possible per blocks for b+ tree organisation? (a) 155 (b) 154 (c) 341 (d) 340 Databases + – focus _GATE 4.0k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply focus _GATE commented May 23, 2015 reply Follow flag i was solving in this way ... p*key_size+(P+1)size of_pointer<=block size where p is keys possible in b+tree node.... and getting p as 340.66667....after taking ceiling value.. ie (341) is this method correct..?? 0 0 replyShare akash commented May 23, 2015 reply Follow flag For B+ tree (m* block pointer)+(m-1)(key)<= Block size so 8m+(m-1)4<=4096 12m<=5100 so m =341 1 1 replyShare focus _GATE commented Jun 29, 2015 reply Follow flag correct option is (d) but i don't how it is.?? 0 0 replyShare Please log in or register to add a comment.
3 3 votes search field is V = 4 bytes long, the block size is B = 4096 bytes, and a block pointer is P = 8 bytes. As internal node of the B+ tree can have up to p tree pointers and p-1 search field values, these must fit into a single block. Hence, we have, (p * 8) + (( p – 1 ) * 4 <= 4096 or (12 * p) <= 5000 p = 416.66 , So max keys are possible is 415 ( we cant consider the fraction ) But is this problem they done it this way As internal node of the B+ tree can have up to p+1 tree pointers and p search field values, these must fit into a single block. Hence, we have, (p+1) * 8 + p * 4 <= 4096 or (12 * p) <= 4088 p = 340.66 , So max keys are possible is 340 ( we cant consider the fraction ) Pranay Datta 1 answered Jun 29, 2015 Pranay Datta 1 comment Share Follow See all 6 Comments 6 6 Comments reply focus _GATE commented Jun 29, 2015 reply Follow flag if this type of question come in GATE as numerical answer !!. than how we can conclude that we have to take our answer as 340 or 341 .???? ho we will distinguish between above those two method that u have expalin.??? 0 0 replyShare Pranay Datta 1 commented Jun 29, 2015 reply Follow flag you have to take the floor value , in case pointer . and for block size if asked then we have to take the celin value . 0 0 replyShare focus _GATE commented Jun 29, 2015 reply Follow flag i did not understand properly.?? :( 0 0 replyShare focus _GATE commented Jun 29, 2015 reply Follow flag ---> (p * 8) + (( p – 1 ) * 4 <= 4096 --->(p+1) * 8 + p * 4 <= 4096 i did not understand which equation is to take .durng solving above type of question?? link https://gateoverflow.in/8555/gate2015-3_46 in above link why they take that equation.?? why not this --> P*12+(P+1)*8<=1024????? 0 0 replyShare Pranay Datta 1 commented Jun 29, 2015 reply Follow flag I dont know which equation to take (maybe hit and trail) , its kind a guessing game . If you guess right then bullseye :D . 0 0 replyShare focus _GATE commented Jun 29, 2015 reply Follow flag i am confused between this which equation to use and when .?? 0 0 replyShare Please log in or register to add a comment.
2 2 votes # of key =lower bound of ( block size/ (key + pointer))=lower bount of ( 4096/(4+8)= lower bound of (341.33)= 341 Prashant. answered May 23, 2015 Prashant. comment Share Follow See 1 comment 1 1 comment reply focus _GATE commented May 23, 2015 reply Follow flag i was solving in this way ...p*key_size+(P+1)size of_pointer<=block sizewhere p is keys possible in b+tree node....and getting p as 340.66667....after taking ceiling value.. ie (341)is this method correct..?? 0 0 replyShare Please log in or register to add a comment.
0 0 votes Ans: (d) Order P = max. keys possible So, the formula to use: P*K + (P+1)*Bp <= BS Here, BS is block size, K is key, Bp is block pointer and P is order. therefore, 4P + (P+1)8 <= 4096 gives 4P + 8P + 8 <= 4096 gives 12P <= 4088 gives P = 340. Pooja Audichya answered Jul 31, 2019 Pooja Audichya comment Share Follow 0 reply Please log in or register to add a comment.