Re: [algogeeks] Sort in Linear time O(n)

2010-10-02 Thread Harshal ..Bet oN iT!!
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 ema

Re: [algogeeks] Sort in Linear time O(n)

2010-10-02 Thread Shreyas
There is a theorem which states that a sorting algorithm must take o(nlogn) to sort a list of any possible values. however there are certain sorts like insertion sort where o(n) in the best case ie when a list is sorted. On 02-Oct-2010, at 10:32 PM, "Harshal ..Bet oN iT!!" wrote: > you are gi

Re: [algogeeks] Sort in Linear time O(n)

2010-10-02 Thread Harshal ..Bet oN iT!!
but the range (k) is cubic in n, if we use counting sort also in radix sort, k wont be of the order n, so how can solution be in linear time? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googl

Re: [algogeeks] Sort in Linear time O(n)

2010-10-02 Thread vaibhav shukla
use radix sort On Sat, Oct 2, 2010 at 10:32 PM, Harshal ..Bet oN iT!! wrote: > you are given n integers in the range 0 to n3-1 ((n to the power 3) - 1) . > how can u sort the numbers in O(n)? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks

[algogeeks] Sort in Linear time O(n)

2010-10-02 Thread Harshal ..Bet oN iT!!
you are given n integers in the range 0 to n3-1 ((n to the power 3) - 1) . how can u sort the numbers in O(n)? -- 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 fro