GATE CS 2025 Set 2 — Question 57
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+2 / -0MediumB+ Tree OperationsIndexing & File OrganizationDatabases
Databases → Indexing & File Organization → B+ Tree Operations
Last updated
Question
In a B-tree where each node can hold at most four key values, a root to leaf path consists of the following nodes:The *-marked keys signify that these are data entries in a leaf.Assume that a pointer between keys and points to a subtree containing keys in , and that when a leaf is created, the smallest key in it is copied up into its parent.A record with key value 23 is inserted into the B-tree.The smallest key value in the parent of the leaf that contains 25* is ___________. (Answer in integer)
Correct answer
33 to 33
Solution
1.Analyze the B-tree properties:
- Max keys per node = 4. This implies the order of the tree (max children) is 5. The minimum number of keys in a node is .
- Path: Root Internal Leaf .
- Node : Keys .
- Node : Keys . Since is on the path to (keys 20-26), must be the child pointed to by the pointer between 19 and 33 in node .
- Node : Keys .
- 23 falls into the range of leaf .
- Insert 23 into : Sorted keys become .
- Number of keys is 5, which exceeds the maximum of 4. Leaf must split.
- We split the 5 keys into two nodes. Valid splits respecting the minimum key count (2) are:
- Option 1: Left , Right . Smallest in Right is 23.
- Option 2: Left , Right . Smallest in Right is 25.
- In both cases, the key 25* ends up in the Right Leaf ().
- The smallest key of the new right leaf (either 23 or 25) is copied up to the parent .
- Original keys in : .
- Insert the copied-up key (let's call it , where or ).
- New key set for : (sorted).
- Number of keys is 5, which exceeds the maximum of 4. Node must split.
- Keys: .
- Median key is (since 7, 19 are smaller and 33, 44 are larger).
- Split:
- Left Internal Node (): .
- Right Internal Node (): .
- Key is pushed up to parent .
- The pointers are redistributed. The new Right Leaf (containing 25*) contains keys . The first pointer of covers the range . Thus, becomes the first child of .
- The leaf containing 25* is .
- The parent of is the new right internal node .
- The keys in are .
- The smallest key value in this parent node is 33.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Indexing & File Organization
2026 Set 2 Q15In the context of DBMS, consider the two sets T and S given below. | T | S | |---|---| | I:…2026 Set 2 Q20Consider concurrent execution of two transactions and in a DBMS, both of which access a…2026 Set 1 Q30Let and be the attributes of a relation in a relational schema. Let…2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 2 Q42In the context of schema normalization in relational DBMS, consider a set F of functional…