The approach by atul is maintaining partitions of array such that element left to it are even and right odd.Its an implementation of quick sort as discussed earlier.Its o(n) no doubt but its not stable.
On Fri, Jul 22, 2011 at 11:51 AM, sunny agrawal <[email protected]>wrote: > @atul > Your algo is not stable > http://www.ideone.com/DrV5J > > BTW what are u trying to do > instead of posting a code please prefer posting a simple algorithm in text > coding part is very easy once the correct algorithm is found > > > On Fri, Jul 22, 2011 at 11:43 AM, Puneet Gautam > <[email protected]>wrote: > >> @atul: can u pls tell me how did u go about solving this in ur mind..? >> >> >> On 7/22/11, Abhi <[email protected]> wrote: >> > @atul: can you please elaborate the algorithm you are using. >> > >> > -- >> > You received this message because you are subscribed to the Google >> Groups >> > "Algorithm Geeks" group. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msg/algogeeks/-/mLtfUz77JMIJ. >> > 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. >> > >> > >> >> -- >> 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. >> >> > > > -- > Sunny Aggrawal > B-Tech IV year,CSI > Indian Institute Of Technology,Roorkee > > -- > 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. > -- Saurabh Singh B.Tech (Computer Science) MNNIT ALLAHABAD -- 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.
