ProgrammingHard

Records (x,5), (y,2), (z,5), (w,2), (v,9) are sorted by key with a stable sort, ascending. What is the order of names?

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

Correct answer: B. y w x z v

A stable sort keeps the input order between equal keys, so y comes before w and x before z.

More C Programming questions

Exams that ask this topic