You are viewing a single comment's thread. Return to all comments →
Java 8
public static List<Integer> countingSort(List<Integer> arr) { // Write your code here // Integer maxInt = Collections.max(arr); int[] intArr = new int[100]; for (Integer arg : arr) { intArr[arg] = intArr[arg] += 1; } return Arrays.stream(intArr).boxed().collect(Collectors.toList()); }
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 8