See More

//计数排序 function counting_sort(A){ const max = Math.max(...A) //累计数组 const B = Array(max+1).fill(0) //结果数组 const C = Array(A.length) //累计位增加 A.foreach((_,index)=>{ B[A[index]]++ }) //累计求和 for(let i =1;i