ProgrammingVery hard
The expected number of probes for an unsuccessful search in linear probing with load factor a = 0.9 is about what?
- A. 50.5
- B. 5.5
- C. 9.0
- D. 100
Correct answer: A. 50.5
(1 + 1 / (0.1)^2) / 2 = (1 + 100) / 2 = 50.5. The cost grows sharply as the table fills.
More C Programming questions
- For a hash map of N = 10^5 entries with 10^5 lookups, which implementation is correct and fast enough in C?
- A chained table has a load factor of 3. A successful search compares the key against nodes until it is found. What is the expected number…
- Keys are stored with h(k) = k % 10 in a chained table. Which key set gives the longest single chain for five keys?
- A table keeps keys as ints in an array of size 2^20 indexed directly by the key. Keys are at most 10^6. Which statement is correct?
- uint32t x = 0u; x = 1103515245u x + 12345u; is applied twice in a row, starting from x = 0. What is x after the second update, computed…
- How many permutations of 4 distinct items have no item in its original position?