Counting Sort (Implementation)

(Reading time: 3 minutes)

We'll cover the following...

We create a function that takes 3 arguments: the array, the minimum value, and the maximum value. In the example above, the minimum value was 0, and the maximum value was 9.

Press + to interact
function countingSort(arr, min, max) {
}

First, we need to initialize an empty index array based on the minimum and ...