You are viewing a single comment's thread. Return to all comments →
Java:
public static List countingSort(List arr) { Integer[] arrayInteger = new Integer[100]; Arrays.fill(arrayInteger, 0); for (Integer integer : arr) { arrayInteger[integer]++; } return Arrays.asList(arrayInteger); }
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 →
Java:
public static List countingSort(List arr) { Integer[] arrayInteger = new Integer[100]; Arrays.fill(arrayInteger, 0); for (Integer integer : arr) { arrayInteger[integer]++; }
return Arrays.asList(arrayInteger); }