Consider a 13 element hash table for which $f(key) = key \pmod{13}$ is used with integer keys. Assuming linear probing is used for collision resolution, at which location would the key 103 be inserted, if the keys 661, 182, 24 and 103 are inserted in that order?
- A. 0
- B. 1
- C. 11
- D. 12
Answer: B. 1
Explanation: 661 % 13 = 11. (Loc 11 occupied)\n182 % 13 = 0. (Loc 0 occupied)\n24 % 13 = 11. Collision. Probe 12. (Loc 12 occupied)\n103 % 13 = 12. Collision. Probe 0 (Occupied). Probe 1 (Free).\nInsert at 1.