Counting Sort 2

  • + 0 comments
        List<int> fresult= new List<int>();
        List<int> result= new List<int>(new int[100]);
        foreach(int a in arr){
    
            result[a]= result[a]+1;
        }
    
    
    
       for(int i=0; i<100; i++){
           int count= result[i];
           for(int j=0; j<=count-1; j++){
    
           fresult.Add(i);
           }
    
    
       return fresult;