[理工] 演算法,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