Counting Sort 1

  • + 0 comments

    c#

    public static List countingSort(List arr)

    {
        List<int> freqArray = new List<int>(new int[100]);
        for (int j = 0; j < arr.Count; j++)
        {
            freqArray[arr[j]] += 1;
        }
        return freqArray;
    }