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.
publicstaticList<Integer>countingSort(List<Integer>arr){int[]counter=newint[100];for(inti:arr){intcurrent=counter[i];counter[i]=current+1;}// Convert Array to List List<Integer>result=newArrayList<>();for(inti=0;i<counter.length;i++){result.add(counter[i]);}returnresult;}
Counting Sort 1
You are viewing a single comment's thread. Return to all comments →
Java Solution
Java 8 Streams