Counting Sort 1

  • + 0 comments

    in JS:

    function countingSort(arr) {
        let countingArray = new Array(100).fill(0);
        for (let num of arr) {
            countingArray[num]++;
        }
        return countingArray;
    }