ProgrammingModerate
Keys 13 and 23 are inserted with linear probing into a table of size 10 with h(k) = k % 10. In which slot does 23 land?
- A. 3
- B. 4
- C. 2
- D. 5
Correct answer: B. 4
Both keys hash to slot 3, 13 occupies it, and 23 probes to slot 4.
More C Programming questions
- Keys 6, 1 and 11 are inserted with linear probing into a table of size 5, h(k) = k % 5. In which order do the keys appear when the table…
- With chaining, what is the expected number of nodes examined by an unsuccessful search when the load factor is 1.5?
- A hash table with 10 buckets receives 11 keys. What is the minimum number of collisions guaranteed?
- Which C code correctly inserts a node n at the front of bucket h of an array of struct node table[]?
- Which operation is needed to make open addressing deletions safe for later lookups?
- A program counts the distinct keys among 10^6 values by inserting them into a hash set with expected O(1) operations. What is the expected…