GATE Computer ScienceVery hardGATE CSE
A hash table of size 11 uses double hashing with h1(k) = k mod 11 and h2(k) = 7 − (k mod 7), probing slot (h1 + i·h2) mod 11 for i = 0, 1, 2, … Keys 10, 21, 32, 43, 54, 65 are inserted in that order. How many slot probes are made in total (counting the final successful probe of each insertion)?
- A. 9
- B. 13
- C. 11
- D. 6
Correct answer: C. 11
Probe counts per key are 1, 2, 2, 2, 2, 2, totalling 11.
More Algorithms questions
- How many distinct spanning trees does the complete bipartite graph K(3,4) have?
- Floyd–Warshall is run on a 5-vertex digraph (vertices 0..4) with arc weights 0→1:3, 0→3:7, 1→0:8, 1→2:2, 2→0:5, 2→3:1, 3→0:2, 3→4:4 (no…
- In how many ways can a longest strictly increasing subsequence be chosen (counting index sets, not distinct value sequences) from the…
- Randomised quicksort picks the pivot uniformly at random from the current sub-array and each partition of m elements uses exactly m−1…
- Bellman–Ford from source 0 on vertices 0..5 relaxes the directed edges (u→v, w) in this fixed order in every pass: 4→5 (1), 3→4 (1), 2→3…
- The recurrence T(n) = 2T(n/2) + n/log₂ n (with T(1) = 1) has the solution