//intput array A,output array result. count array count .
//all the elements is in te range of 0~k.
//if k=O(n),the complexity is Θ(n)
//counting sort is stable
for(i=0;i<n;i++)result[i]=0;
for(i=1;i<=n;i++)count[a[i]]++;
for(i=1;i<=n;i++)count[i]+=count[i-1];
for(j=n;j>1;j--)
{
result[count[A[j]]]=A[j];
count[A[j]]--;
}
/radix sort
//对每一位数字进行排序,收集后,递归进行,直到全部排序完成
//bucket sort
//按区间分布bucket,bucket内部使用insert sort.