but you have already given the range of numbers from 1 to 10000 for which I think it should work pretty fine. We can just keep a count of every number arriving in an array since we know its in the range 1..10000 and later get the sorted array accordingly repeating the elements that many times. Its almost trivial this way. I did not get your statement completely "if word size is more then its quite inefficient". Any algorithm you choose for this you may mostly need to work on such arithmetic(addition in this case). Do you want some algo with some bit level operations? Correct me if I am wrong.
Anurag Sharma On Wed, Jun 9, 2010 at 9:29 PM, sharad kumar <[email protected]>wrote: > @ anurag we can do operation only at bit level so....we will need o(32n) > although it is also O(n) bt if word size is more then its quite inefficient > so suggest 4 that > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
