随笔 - 65  文章 - 0  评论 - 21  阅读 - 32万
  2013年3月14日
摘要: 计数排序(Counting sort)维基百科:http://en.wikipedia.org/wiki/Counting_sort时间复杂度:O(n)技术排序的基本思想:对每一个输入元素 x ,确定小于 x 的元素个数。利用这一信息,就可以直接把 x 放到它在输出数组中的位置上了。伪码:COUNTING-SORT(A, B, k) let C[0 .. k] be a new array for i = 0 to k C[i] = 0 for j = 1 to A.length C[A[j]] = C[A[j]] + 1 // C[i] now contains the ... 阅读全文
posted @ 2013-03-14 21:25 Anthony Li 阅读(526) 评论(0) 推荐(0) 编辑
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

博客园博客已停止更新,博客地址:dyinigbleed.com

点击右上角即可分享
微信分享提示