Counting Sort 1

  • + 0 comments

    MInha soluçao com ajuda rs

     public static List<Integer> countingSort(List<Integer> arr) {
    

    int [] freq = new int [100]; Arrays.fill(freq, 0);

    for(Integer a : arr){ freq[a]++; }

    List results = new ArrayList<>();

    for(int i = 0; i < 100; i++){ results.add(freq[i]); }

    return results;
    
    
    
    }
    

    }