Explain 'Counting Sort' constraints.
Explain 'Counting Sort' constraints.
Approach: Describe when the algorithm is efficient.
It is only efficient when the range of input values (k) is not significantly larger than the number of items (n). It requires auxiliary memory proportional to the range.
Follow-up: What is the complexity if k = n^2?
Key concepts: range k, O(n+k), memory.