ProgrammingModerate
A table of size 7 with h(k) = k % 7 is filled with 7 keys using linear probing and no deletions. How many more keys can be inserted before the table is full?
- A. 1
- B. 0
- C. 7
- D. 6
Correct answer: B. 0
A table with 7 slots is full after 7 keys. Linear probing needs an empty slot to terminate, so no more keys fit.
More C Programming questions
- Which search code is correct for an open-addressing table of size m with linear probing, where an empty slot ends the search?
- A hash table stores pointers to nodes allocated with malloc. What must happen when the table is destroyed?
- The expected number of probes for an unsuccessful search in linear probing with load factor a = 0.9 is about what?
- 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?