CS FundamentalsVery hardGATE CS (PYQ pattern)
A linear hashing file starts with 2 buckets (hash h0 = k mod 2, then h1 = k mod 4, h2 = k mod 8, ...), a bucket holds 2 keys before it overflows, and every insertion that makes a bucket exceed 2 keys (overflow goes to a chain) triggers a split of the bucket at the split pointer (initially bucket 0), after which the pointer advances (and the round restarts when it reaches the end). Keys inserted: 4, 8, 12, 16, 5, 9, 3, 7, 11, 2, 6. How many buckets exist at the end, and where is the split pointer?
- A. 5 buckets, split pointer 1
- B. 6 buckets, split pointer 1
- C. 5 buckets, split pointer 2
- D. 4 buckets, split pointer 0
Correct answer: A. 5 buckets, split pointer 1
Simulating each insertion and split gives buckets [[8, 16], [5, 9], [2, 6], [3, 7, 11], [4, 12]] with the pointer at 1 (level 1).
More DBMS and SQL questions
- A B+ tree index is built on (a, b) in this order. For which of these predicates can a search descend directly to a contiguous range of…
- Which of the following relational-algebra identities are valid for union-compatible relations R and S? I. σ{A=1}(R ∪ S) = σ{A=1}(R) ∪…
- R(A, B) has 100 tuples; R.B is a foreign key to S(B), which is S's primary key, but R.B allows NULL and 10 tuples of R have B = NULL. S…
- Three transactions each run x = x + 10 as an unprotected read followed by a write of (value read + 10), on a shared x that starts at 0…
- R(A, B, C, D, E, F) has the functional dependencies B → E, F → A, BC → F, AF → D, C → B. What is the highest normal form of R (1NF, 2NF…
- R(A, B, C, D, E) has the functional dependencies D → C, DC → B, A → B, AC → E, C → A, E → C, D → E. How many of the listed dependencies…