ProgrammingHard
A hash table with open addressing and a load factor of 0.9 is used. Why is this risky?
- A. Hashing stops working for any load above 0.5 in C
- B. The table must then use malloc for every key
- C. The keys are sorted automatically and then lost
- D. Probe sequences become long, so lookups and inserts slow down sharply
Correct answer: D. Probe sequences become long, so lookups and inserts slow down sharply
Linear probing cost grows like 1 / (1 - a)^2, so a load of 0.9 makes unsuccessful searches very expensive.
More C Programming questions
- A chained table uses the key modulo 7 for 7 buckets. Keys 3, 10, 17, 24 are inserted. What is the length of bucket 3?
- A list reversal is done in place, and then the list is traversed to print it. What is the time for the reversal alone on n nodes?
- A singly linked list of 2 x 10^5 nodes receives 2 x 10^5 insertions at the front and 2 x 10^5 deletions from the front. What is the total…
- A doubly linked list deletes its head by setting new head = head->next and then new head->prev = NULL. What happens if the list had only…
- printf("%d", (5 & 3) << 2 | 1); What is printed?
- int x = 16; printf("%d", x >> 2 ^ 3); What is printed?