Hi, how about this - Do a merge sort, now, while merging two sorted list, give more priority to odd numbers :)
I believe this falls into the right solutions :) Any breaking cases? On 24 June 2010 09:41, Gaurav Singh <[email protected]> wrote: > I think in this case, bubble sorting will be a better idea. just > replace the condition of comparison with the condition that earlier > number is even and later number is odd. I mean we can do sumthing lyk > this : > > for i=1 to n-1 > for j=1 to n-i-1 > if iseven(ar[j]) AND (NOT iseven(ar[j+1])) > then swap both of them. > > Please correct me if I am wrong somewhere. > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- "Reduce, Reuse and Recycle" Regards, Vivek.S -- 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.
