Setup Array
Sort Controls
Array Visualization
Original Array:
Count Array:
Output Array:
Colors: Orange = Counting, Blue = Current, Purple = Placing, Yellow = Count Array, Green = Sorted
Counting Sort is a non-comparison sorting algorithm that sorts elements by counting occurrences of each distinct element.
How it works:
Time Complexity: O(n + k) where k is range of input