CS FundamentalsVery hardGATE CS
A B+ tree is built so that every node is completely full: a leaf holds 100 keys and an internal node has 101 children. It indexes 1,000,000 distinct keys. How many levels (root to leaf, both counted) does the tree have?
- A. 2
- B. 3
- C. 4
- D. 5
Correct answer: B. 3
Leaves: 1,000,000 / 100 = 10,000. Their parents: ceil(10,000 / 101) = 100 nodes. Those need ceil(100 / 101) = 1 root. That is 3 levels.
More DBMS and SQL questions
- R(A, B, C, D, E) has the functional dependencies AB -> C, C -> D, D -> E and E -> A. How many candidate keys does R have?
- Consider the schedule R1(A), W2(A), W1(A), W3(A). Which statement is correct?
- W(d, x) holds (1, 10), (2, 20), (2, 30), (3, 40). What value does SUM(x) OVER (ORDER BY d) give on the row (2, 20)?
- Under the SQL standard's isolation levels, which anomaly can still occur at REPEATABLE READ but is prevented at SERIALIZABLE?
- Which pair of properties must every primary key satisfy?
- Which ACID property guarantees that a transaction's changes are applied completely or not at all?