You are viewing a single comment's thread. Return to all 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; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 1
You are viewing a single comment's thread. Return to all comments →
MInha soluçao com ajuda rs
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]); }
}