69 69 votes With reference to the $B^+$ tree index of order $1$ shown below, the minimum number of nodes (including the Root node) that must be fetched in order to satisfy the following query. "Get all records with a search key greater than or equal to $7$ and less than $15$ " is ______. Databases gatecse-2015-set2 databases b-tree normal numerical-answers + – go_editor 23.9k views answer comment Share Follow Print See all 17 Comments 17 17 Comments reply Show 14 previous comments jacknroll commented Sep 24, 2025 reply Follow flag there is no type or nothing wrong here order mean doesnot always that max number of total pointers in b+ tree here what if order p means p+1 keys or maybe some author dependent ,i guess professor only took half question from somewhere where subparts may needed order value but in our question it is not needed and bidirection shows a special case in b+tree b tree can have many cases and this is one of them try to find things from given tree thats the rules 4 4 replyShare Aditya_Khopade commented Nov 24, 2025 reply Follow flag for this question those who have doubt regarding the order of tree, If you check few old pYQ you will find that order and degree are often used interchangebly. for a b+tree of order d the key values ranges from d to 2d. 2 2 replyShare petals90 commented Mar 9 reply Follow flag What does the accepted answer to this question mean when written as "...whichever way you go from root to leaves..." ? Given the query "Get all records with a search key greater than or equal to 7 and less than 15", do we even have this discretion to visit a node which is greater than 9 ? 0 0 replyShare Please log in or register to add a comment.
Best answer 106 106 votes whichever way you go from the root to leaves, you'll always end up counting $5$ nodes. amarVashishth answered Dec 26, 2015 • edited Jun 15, 2021 by S k Rawani amarVashishth comment Share Follow See all 15 Comments 15 15 Comments reply Show 12 previous comments Vaibdoesit commented Sep 6, 2025 reply Follow flag As far as i remeber, the data is stored in the leaves itself in B+ TRees? no? 0 0 replyShare Aditya_Khopade commented Nov 24, 2025 reply Follow flag yeah 0 0 replyShare petals90 commented Mar 9 reply Follow flag @phaniphani A different definition of order is being used here . It is referring to the minimum number of keys a node can hold and not the maximum number of child pointers. 0 0 replyShare Please log in or register to add a comment.
22 22 votes The total number of nodes accessed including root will be 5. The order is, (9)-->(5)-->(5,7)-->(9,11)-->(13,15). Gate Keeda answered Feb 12, 2015 Gate Keeda comment Share Follow See 1 comment 1 1 comment reply Kaluti commented Sep 20, 2018 reply Follow flag I am also not getting why in the leaf nodes doubly linked nodes are used here. Leaf nodes in b plus tree store record pointer as well as block pointer is that they wanna to represent by doubly linked list 1 1 replyShare Please log in or register to add a comment.
9 9 votes The question wants us to perform a range query from 7 to 14 (both inclusive) on a $B^+ \ tree$ This requires for us to first reach the leaf node that has 7, and then traverse in a forward direction until we reach 14. Or vice versa. This works because:- ALL the keys can be found in the leafs of a $B^+ \ tree$ — which are interconnected. Keys are arranged in sorted order. Hence, just finding one end of the range is enough. So, we need 3 accesses (counting root) to reach the leaf that has one end of the range. Then 2 more accesses to reach the other end. So, 5 Refer to the pictures in amarVashishth sir's answer for clarity. JashanArora answered Oct 2, 2019 • edited Jan 23, 2020 by JashanArora JashanArora comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes we are given with a B+ tree in which the key and data pointers are present along with a single block pointer at each leaf node. we need to get some records, we can start from left or start from right. if start from left, 5 nodes need to be fetched similar for the right as well. as it is bidirectionally, normally it isn't so answer 5. usher answered Dec 12, 2024 usher comment Share Follow 0 reply Please log in or register to add a comment.