CS FundamentalsVery hardGATE CS
A B+ tree stores 1,000,000 keys. Each internal node has at most 50 children (at least 25, except the root, which needs at least 2), and each leaf holds 20 to 40 keys. Counting the leaf level, how many levels can the tree have?
- A. Exactly four
- B. 3 to 4
- C. 4 to 5
- D. 3 to 5
Correct answer: C. 4 to 5
Fewest levels: at least 25,000 leaves are needed and 50³ = 125,000 ≥ 25,000 but 50² is not, so 4. Most levels: there are at most 50,000 leaves, and a tree of h levels has at least 2 × 25^(h−2) leaves, which is 31,250 for h = 5 but 781,250 for 6, so 5. Forgetting the root's lower limit of 2 gives exactly 4.
More DBMS and SQL questions
- R occupies 1000 blocks and S 500 blocks; 50 buffer blocks are available. Ignoring the cost of writing the result, what does a Grace hash…
- A table has 1,000,000 rows stored 20 per block. An unclustered B+ tree index fetches each matching row with one random block read (ignore…
- R(A, B) = {(1, x), (2, y), (3, z)} and S(B, C) = {(x, 5), (x, 6), (w, 7)}. How many tuples are in the natural full outer join of R and S?
- Customer(cid, city) LEFT OUTER JOIN Orders(oid, cid, amt) on cid is followed by the selection amt > 100. An optimiser wants to push this…
- An ER diagram has Student (key roll, multivalued attribute phone), Course (key cid) and Faculty (key fid). Enrols is many-to-many between…
- R has 2000 tuples with 100 distinct values of attribute b; S has 5000 tuples with 250 distinct values of b. Assuming uniform values and…