摘要: 1 #include 2 #include 3 const int N = 10000; 4 const int RADIX = 10; 5 int a[N]; 6 int count[RADIX]; 7 void radixSort(int n) 8 { 9 int *bucket ... 阅读全文
posted @ 2014-11-06 19:09 justPassBy 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1 //计数排序的思想是这样的,如果小于等于a的数字有n个,那么就把a放在第n+1个位置,从而达到排序的目的 2 //关键是怎么统计小于等于a的数字有多少个, 3 /* 4 可以采用这样一个办法,将数组元素的值映射为下标,统计该下标出现了多少次,然后再统计比该下标小或者等的下标出现了多少次, 5 ... 阅读全文
posted @ 2014-11-06 16:45 justPassBy 阅读(171) 评论(0) 推荐(0) 编辑