ProgrammingModerate

A chained table has 4 buckets with h(k) = k % 4. Keys 1 and 5 are inserted with head insertion. Which key is first in bucket 1?

  1. A. 1
  2. B. 9
  3. C. 5
  4. D. none, since they collide

Correct answer: C. 5

Both keys go to bucket 1. Head insertion puts the last inserted key first, so 5 comes before 1.

More C Programming questions

Exams that ask this topic