Counting Sort 1

  • + 0 comments
    //Java solution
     public static List<Integer> countingSort(List<Integer> arr) {
        // Write your code here
         Integer countArr[] = new Integer[100];
         Arrays.fill(countArr, 0);
         for(int i=0;i<arr.size();i++){
             countArr[arr.get(i)]++;         
         }  
          return Arrays.asList(countArr);  
        }