CS FundamentalsVery hardGATE CS (PYQ pattern)
A B+ tree on 8-byte keys uses 4096-byte blocks. An internal node holds p tree pointers (8 bytes each) and p − 1 keys. A leaf holds q (key, 8-byte record pointer) pairs plus one 8-byte next-leaf pointer. Each node fills exactly one block as fully as possible. The maximum number of records indexed by a tree with three levels (root, one internal level, leaves) is:
- A. 16,777,216
- B. 16,711,680
- C. 16,581,375
- D. 16,646,400
Correct answer: B. 16,711,680
For internal nodes 8p + 8(p − 1) ≤ 4096 gives p = 256. For leaves 16q + 8 ≤ 4096 gives q = 255. Records = 256 × 256 × 255 = 16,711,680; 256³ ignores the leaf's next pointer.
More DBMS and SQL questions
- E(id, dept) = (1, 10), (2, 10), (3, 20), (4, 30), (5, NULL), (6, 20), (7, 40) and D(did, loc) = (10, X), (20, Y), (20, X), (30, Y), (50…
- S(v) holds the nine rows 10, 20, 20, 30, 30, 30, 40, 40, 50. The query SELECT SUM(v) OVER (ORDER BY v) FROM S uses the default frame. What…
- Emp(id, dept, sal) = (1, A, 50), (2, A, 70), (3, A, NULL), (4, B, 40), (5, B, 60), (6, B, 60), (7, NULL, 90), (8, C, 30). How many rows…
- Ed(a, b) = (1, 2), (1, 3), (2, 4), (3, 4), (4, 5), (4, 6), (5, 7), (6, 7), (2, 5) is a directed acyclic graph. The query WITH RECURSIVE…
- O(cust, item) = (c1, x), (c1, x), (c1, y), (c2, z), (c2, NULL), (c3, NULL), (c3, NULL), (c4, w), (c4, w), (c5, p), (c5, q), (c5, p). How…
- R(x) = (1, 2, 2, 3, NULL, NULL, 5), S(x) = (2, 3, 3, NULL, 6), T(x) = (2, 2, 3, NULL, 5, 7) (one column each). How many rows does (SELECT…