We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Counting Sort 1
- Discussions
Counting Sort 1
Counting Sort 1
Sort by
recency
|
128 Discussions
|
Please Login in order to post a comment
C++
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); }
This problem is just meaningless... Why not create an array with the length of max value in the given array plus one.
My TypeScript solution: