Re: [algogeeks] Re: Variant Of Dutch National Flag Problem

2010-06-19 Thread manisha nandal
in place constraint is violated in radix 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 email to algogeeks+unsubscr...@googlegroups.c

Re: [algogeeks] Re: Variant Of Dutch National Flag Problem

2010-06-19 Thread Amit Jaspal
I think radix sort will do. On Sat, Jun 19, 2010 at 6:03 PM, manisha nandal wrote: > this is not d final solution, trying to find a way > > 3B, 1R, 4Y, 2R, 5B, 7Y > > 1) Find max no. in the array i.e 7 > max=7 > > 2) assign values as R= max B=2*max Y=3*max > i.e R=7 B=14 R=21 > > 3) 3B = 3 +

Re: [algogeeks] Re: Variant Of Dutch National Flag Problem

2010-06-19 Thread manisha nandal
this is not d final solution, trying to find a way 3B, 1R, 4Y, 2R, 5B, 7Y 1) Find max no. in the array i.e 7 max=7 2) assign values as R= max B=2*max Y=3*max i.e R=7 B=14 R=21 3) 3B = 3 + 14=17 1R = 1 + 7 = 8 4Y = 4 + 21 = 25 and so on 4) numbers are as follows 17, 8, 25,

Re: [algogeeks] Re: Variant Of Dutch National Flag Problem

2010-06-18 Thread Amit Jaspal
@ above We have to do this inplace. On Fri, Jun 18, 2010 at 10:30 AM, Gaurav Singh wrote: > You may apply Radix sort here. > Sort on the basis of color first and then apply stable sort on the > digits. So on the whole you will be applying radix sort. > > -- > You received this message because yo

[algogeeks] Re: Variant Of Dutch National Flag Problem

2010-06-18 Thread Gaurav Singh
You may apply Radix sort here. Sort on the basis of color first and then apply stable sort on the digits. So on the whole you will be applying radix sort. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to al