CS FundamentalsVery hardGATE CS (PYQ pattern)
A B+ tree has leaf nodes holding at most 3 keys. Keys are inserted in the order 50, 20, 80, 10, 30, 60, 90, 70, 40, 25, 35, 5, 65, 75, 95, 85, 45, 55 starting from an empty tree. When a leaf overflows (4 keys) it splits into two leaves of 2 keys each. How many leaf nodes exist after all insertions?
- A. 6
- B. 8
- C. 10
- D. 9
Correct answer: B. 8
Simulate each insertion into the correct leaf and split on overflow (2 + 2 keys); the final leaves are [[5, 10], [20, 25], [30, 35], [40, 45], [50, 55, 60], [65, 70, 75], [80, 85], [90, 95]], i.e. 8 leaves for 18 keys (average fill 2.25).
More DBMS and SQL questions
- A query joins 5 relations R1..R5 and the optimiser considers every possible join tree, including bushy trees, with every distinct…
- R occupies 1000 pages with 100 tuples per page. S has a B+ tree index on the join attribute (3 levels, so 3 page reads to reach a leaf…
- A table has 100,000 rows in 2500 pages, and a predicate selects 3% of the rows, which are spread uniformly at random over the pages. An…
- A heap file stores 1,000,000 fixed-length records of 150 bytes in 8192-byte blocks with no block header; records do not span blocks. How…
- R(A, B, C, D, E, F) has the functional dependencies BC → D, F → D, F → C, C → D, E → C, DC → E. Counting only the listed dependencies, how…
- R(A, B, C, D, E, F) has the functional dependencies B → E, E → D, B → E, EB → A, A → F. Decompose R into BCNF by this procedure: while…