//è®¡æ°æåº
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