Data Structures & AlgorithmsHardTCS NQT · sorting

Problem: Which property makes counting sort stable and therefore usable inside radix sort?

  1. A. It places equal keys in the order they appear in the input
  2. B. It sorts the keys in place
  3. C. It uses comparisons only
  4. D. It uses random pivots

Correct answer: A. It places equal keys in the order they appear in the input

A stable pass preserves the relative order of equal keys from the previous digit, which radix sort relies on.

More Coding Interview Problems questions

Exams that ask this topic