i was talking about the space complexity.. running time is obvs O(n)

On Thu, Jul 1, 2010 at 9:14 PM, Gene <gene.ress...@gmail.com> wrote:

> On Jun 30, 3:38 am, Debajyoti Sarma <sarma.debajy...@gmail.com> wrote:
> > @Gene
> > your code's last 3 line gives doubt.
> >  .......
> >  for (i = j = 0; j < M; j++)
> >    while (c[j]--)
> >      a[i++] = j;
> > .......
> > Is it don't make the complexity more than O(n) ??
>
> Not at all. The inner loop body executes n times no matter what the
> value of M is.
>
> Guys, this is just a special case of counting sort.  Obviously 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 from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
With Regards,
Jalaj Jaiswal
+919026283397
B.TECH IT
IIIT ALLAHABAD

-- 
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.

Reply via email to