Counting sort doesn't work that way. The algo inherently requires O(N)
storage for the counting array which effectively makes the algorithm running
time O(N). If the range of values were known before hand, then the counting
array would be of fixed size thus catering to what you need. But if the
range of value is unknown and the algo determines it before sorting, then I
believe we'r out of luck.

Cheerios
Ramaswamy

On 8/30/07, Ravi <[EMAIL PROTECTED]> wrote:
>
>
> How to modify counting sort so that it sorts the elements in place,
> i.e. using extra amount of memory that is constant and independent of
> the size of the input.
>
>
> >
>


-- 
Its wierd, but sometime you find things that are more important to you than
things you think that are important. You know what I mean? Maybe its just
getting older ;)

http://ramaswamy.r.googlepages.com

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to