Data Structures & AlgorithmsVery hardICPC regional · hashing
Problem: What is the expected number of random probes needed in open-addressing hashing with load factor alpha under uniform probing (unsuccessful search)?
- A. Exactly n
- B. About 1 / (1 - alpha)
- C. About log n
- D. About alpha^2
Correct answer: B. About 1 / (1 - alpha)
For uniform probing, the expected probes for an unsuccessful search are about 1/(1 - alpha).
More Coding Interview Problems questions
- Problem: What is the complexity of checking whether a number n is prime by trial division up to sqrt(n)?
- Problem: Edges of an undirected graph on vertices 0–4 are processed in the given order: e1 = 0-1, e2 = 1-2, e3 = 2-3, e4 = 3-4, e5 = 4-0…
- Problem: How many spanning trees does the cycle graph C5 (5 vertices in one cycle) have?
- Problem: A directed graph on vertices 0–5 has arcs 0→1, 1→2, 2→0, 2→3, 3→4, 4→3, 4→5, 5→1. How many vertices have in-degree equal to…
- Problem: On the undirected graph with edges 0-1 (4), 0-2 (1), 2-1 (2), 1-3 (5), 2-3 (9), 3-4 (3), find the minimum number of edges used by…
- Problem: The rooted tree (root 1) has children 1: [2, 3], 2: [4, 5], 3: [6], 4: [7], 6: [8]. How many nodes have a depth divisible by 3…