@radhakrishnan: Counting sort in this case, will be O(n2).. as it involves traversing the entire array!
On Jun 26, 5:03 pm, L <prnk.bhatna...@gmail.com> wrote: > Count sort is O(n+k), since k~n^2 here, it will be O(N^2). > Radix sort has complexity O(r.n) which is nearly O(n logn). > Are you sure that the person asking this question wanted O(n) ? > > On Jun 26, 1:31 pm, radha krishnan <radhakrishnance...@gmail.com> > wrote: > > > > > > > > > Yes ! Count Sort !! > > > On Sun, Jun 26, 2011 at 1:44 PM, ross <jagadish1...@gmail.com> wrote: > > > Given a sequence of numbers in the range of 1-N^2, what is the most > > > efficient way to sort the numbers (better than NlgN).. > > > Can counting sort be used here? Is an O(N) solution possible.. > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "Algorithm Geeks" group. > > > To post to this group, send email to algogeeks@googlegroups.com. > > > To unsubscribe from this group, send email to > > > algogeeks+unsubscr...@googlegroups.com. > > > For more options, visit this group > > > athttp://groups.google.com/group/algogeeks?hl=en. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@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.