You are viewing a single comment's thread. Return to all comments →
My JavaScript solution:
function countingSort(arr) { counter=new Array(arr.length).fill(0) result=[] for(let value of arr){ counter[value]+=1 } let index=0 for(let value of counter){ result.push(...Array(value).fill(index)) index+=1 } return result }
Seems like cookies are disabled on this browser, please enable them to open this website
Counting Sort 2
You are viewing a single comment's thread. Return to all comments →
My JavaScript solution: