Skip to content
Official PYQ · 2015

GATE CS 2015 Set 2 Q6 — File Organization and Indexing (B and B+ Trees)

Explain with AI

With reference to the B+B^+ tree index of order 11 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 77 and less than 1515 " is ______.

View worked solution

Answer: 5

To satisfy the query "greater than or equal to 77 and less than 1515" (i.e., 7≤key<157 \le \text{key} < 15), we first search for the key 77 from the root and then traverse the leaf nodes sequentially using sibling pointers.

The step-by-step node access is as follows:

  1. Root Node (contains 9): Since 7<97 < 9, we follow the left pointer to the child node.
  2. Internal Node (contains 5): Since 7≥57 \ge 5, we follow the right pointer to the leaf node.
  3. First Leaf Node (contains 5, 7, 8): We retrieve the key 77 and follow the leaf sibling pointer.
  4. Second Leaf Node (contains 9, 11): We retrieve the keys 99 and 1111, then follow the sibling pointer.
  5. Third Leaf Node (contains 13, 15): We retrieve the key 1313 (since 13<1513 < 15). Since 1515 is not strictly less than 1515, the search terminates here.

Thus, the minimum number of nodes that must be fetched is 5.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore File Organization and Indexing (B and B+ Trees) questions