[理工] 算法,sorting问题

楼主: nsysukober (安安)   2014-12-06 21:08:49
题目是
Suppose that n numbers are to be sorted, each of which is an integer in the
following interval. Design a linear time algorithm for this problem, or show
that this is impossible.
(a) [0,n-1]
(b) [0,(n,2)-1] (n平方)
(c) [0,(n,3)-1] (n三次方)
不太懂题目要干嘛,不知道怎么下手
是要问说,sort 0~n-1个数可不可能在linear time达到?
那我一开始要怎么下手?
谢谢哦>_<!
作者: kather (Kather)   2014-12-06 22:39:00
(a) counting sort (b) radix sort (c) radix sort
楼主: nsysukober (安安)   2014-12-06 23:23:00
好的 我研究看看 谢谢噜

Links booklink

Contact Us: admin [ a t ] ucptt.com