Is this like the segregating all the 1's to the right and the 0's to the left or am i missing something?
On Sat, Sep 24, 2011 at 9:39 AM, VIHARRI <[email protected]> wrote: > You are given a string (consisting of 0's, 1's or 2's) where 0 > represents a blue ball, 1 a > red ball, and 2 a black ball. Using only swap operations (counting > sort not allowed) > rearrange the string such that all blue balls are together on one > side, followed by all red > balls, and then all black balls. You can iterate through the string > only once. > Eg 102112011 should produce 001111122? > > > -- > 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. > > -- Anup Ghatage -- 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.
