The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from hash table with chaining's own run on the numbers shown.
choose one
1question 1
An empty table of 5 buckets puts in 23, 41, 18, 33 and 6, in that order. How many looks do the five puts make in all?
the answer, and why
the answer is C
23 and 41 find empty buckets, 0 looks. 18 meets 23 in bucket 3, 1. 33 meets 23 and 18, 2. 6 meets 41 in bucket 1, 1. That is 4.
step 9 of 16
33 leaves 3 when divided by 5, so it belongs in bucket 3.
compared: 0
step 10 of 16
23 is not 33.
compared: 1
step 11 of 16
18 is not 33.
compared: 2
step 12 of 16
33 is not in bucket 3 yet, so put it in.
compared: 2
Operation 4 puts 33 in. Bucket 3 holds 23 and 18, so 2 looks. Yellow is being compared, red just put in.
if you chose another
AThat counts every number before each put, as if all shared one bucket.
BThat counts only 33's 2 looks, but 18 meets 23 and 6 meets 41 too.
DThat counts 1 look a put after the first two, but 33 meets two numbers.