Counting Sort 2

  • + 0 comments

    here is my Python solution

    def countingSort(arr):
        freq=[0]*100
        s_arr=[]
        for i in arr:
            freq[i]+=1
        
        for i in range(len(freq)):
            num=[i]*freq[i]
            s_arr.extend(num)
            
        return s_arr