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
|
655 Discussions
|
Please Login in order to post a comment
In java:
Remember that the dimension of the output is predetermined... "int[100]: a frequency array"
Java 8
List count = new ArrayList<>(Collections.nCopies(100, 0)); for (int num : arr) { count.set(num, count.get(num) + 1); } return count; }
' def countingSort(arr): # Write your code here count = [0] * 100
'