All mock tests are FREE till 31 December — register to save your progress
Unit 7 · Data Structures and Algorithms Paper 2 CS · September 2022

Consider a hash table of size 11 that uses open addressing with linear probing, with h(k) = k mod 11. Records with keys 43, 36, 92, 87, 11, 47, 11, 13, 14 are inserted into an initially empty table with bins 0–10. What is the index of the bin into which the last record is inserted?

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. 7

Explanation

43 → 10, 36 → 3, 92 → 4, 87 → 10 taken → 0, 11 → 0 taken → 1, 47 → 3, 4 taken → 5, 11 → 0, 1 taken → 2, 13 → 2…5 taken → 6, 14 → 3…6 taken → 7.

More Data Structures and Algorithms questions