ProgrammingVery hard

Records (x,5), (y,2), (z,5), (w,2), (v,9) are reduced to one record per key by keeping the last record seen for each key, then sorted by key. Which names remain in order?

  1. A. y x v
  2. B. w z v
  3. C. x w v
  4. D. w z y

Correct answer: B. w z v

The last record with key 2 is w, with key 5 it is z, and with key 9 it is v. Sorted by key these are w, z, v.

More C Programming questions

Exams that ask this topic