Explain 'Counting Sort'.

Explain 'Counting Sort'.

Approach: Describe a non-comparative sorting algorithm for small range integers.

A non-comparative sorting algorithm that works by counting the number of objects having each distinct key value and using arithmetic to determine their positions in the output.

Follow-up: Can it sort negative numbers?

Key concepts: frequency array, O(n+k), integers.