Counting sort

[2, 0, 2, 1], values 0 to 4 → [1, 1, 2, 0, 0]

You can also choose a level by clicking its number.

About the course

Description
The array of occurrence counts and the position where values start in the sorted array
More information
Arrays are indexed from zero. Sorting is ascending (from the smallest) unless stated otherwise.
Sample question
[2, 0, 2, 1], values 0 to 4 → [1, 1, 2, 0, 0]
Author
Jiří Preisler
Version
1.0