As far as I know; Count sort is O(n+M) where M is the maximum value. Radix sort is O((n+c)k) where k is the number of digits and c is the cost of sorting a digit. So in this case if the number were represented as binary it would be 2, so k = log_2(n^3) = 3logn and c=2. So the complexity would be O(n^2). If instead of binary a radii of n is used, although k = log_n(n^3) = 3, the c is O(n) with count sort, so i guess O((n+n)3) ) = O(n)
On Oct 2, 10:04 pm, Mridul Malpani <malpanimri...@gmail.com> wrote: > Radix sort is independent of the range and only depends on the number > of items. >l > here k=max value= n^3. > since , radix sort is independent of k, so here also it sorts "n > integers" in O(n). > > On Oct 2, 10:38 pm, "Harshal ..Bet oN iT!!" <hc4...@gmail.com> wrote: > > > > > this theorem is true for comparision sorts only! counting sort is not a > > comparison sort. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.