You are viewing a single comment's thread. Return to all comments →
function countingSort(arr) { let count = new Array(100).fill(0); let result=[]; for(let i=0;i<arr.length;i++) count[arr[i]]++; for(let i=0;i<100;i++) { while(count[i]>0){ result.push(i) count[i]--; } } 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 →
NodeJS