GATE Computer ScienceVery hardGATE CSE · UGC NET
A hash table of size 13 uses double hashing: the i-th probe for key k is (k mod 13 + i·(1 + k mod 11)) mod 13. The keys 18, 41, 22, 44, 59, 32, 31, 73, 5, 70 are inserted in this order. In which slot does key 70 end up?
- A. 10
- B. 11
- C. 1
- D. 6
Correct answer: A. 10
Tracing the probe sequences, earlier keys occupy slots ["2:41","4:32","5:18","6:44","7:59","8:73","9:22","10:70","11:5","12:31"] and key 70 lands in slot 10.
Practise more Programming and Data Structures (GATE) questionsProgramming and Data Structures (GATE): notes and key points
More Programming and Data Structures (GATE) questions
- Keys 40, 20, 60, 10, 30, 50, 70, 5, 15, 25, 35, 45, 55, 65, 80, 3, 12, 23, 27, 90 are inserted into an empty BST. How many nodes have a…
- In a knockout (tournament-tree) method, what is the minimum number of comparisons needed in the worst case to find both the smallest and…
- A binary heap stored in A[1..200] has the usual shape (complete binary tree, children of i at 2i and 2i+1). Taking the height of a leaf as…
- int f(int n) { if (n == 0) return 0; return (n & 1) + f(n >> 1) + f(n >> 2); } What does f(100) return?
- Assume sizeof(int) = 4 and sizeof(int ) = sizeof(int ()[4]) = 8. int a[3][4]; / a[i][j] = 4i + j / int (r)[4] = a + 1; int p = (r + 1) +…
- #include <stdio.h> int main() { int a[5] = {10, 20, 30, 40, 50}; int p = (int )(&a + 1); printf("%d %d", (a + 1), (p - 2)); } What is…