Question
Official answer and solution
- Official answer
- 5
- From
- Official GATE 2015 answer key
Solution
Trace the B+ tree traversal path from root to leaf to find the initial search key, then follow leaf sibling pointers across the range.
The query asks for all records with key .
Step 1: Traverse the tree index to locate the lower bound key .
- Fetch Node 1 (Root
[9 | -]): Since , follow the left child pointer. - Fetch Node 2 (Internal node
[5 | -]): Since , follow the right child pointer. - Fetch Node 3 (Leaf node
[5 | 7]): Key is found in this leaf node.
Step 2: Traverse leaf sibling pointers to retrieve subsequent keys in the range :
- Follow the sibling pointer to Fetch Node 4 (Leaf node
[9 | 11]): Both keys and satisfy . - Follow the sibling pointer to Fetch Node 5 (Leaf node
[13 | 15]): Key satisfies . Key violates , terminating the range scan.
Total nodes fetched = .
5
Omitting the root node or forgetting to count the final leaf node [13 | 15] where the terminating condition is detected.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2015 Computer Science and Information Technology (CS) Session 2
- Question
- 16 of 65, printed as CS Q.6
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.