@ gurav vivek i think u r only exchanging odd and even.. only putting even to end and odd in front and not doing descending sorting on odds and ascending on even..
plz correct me if i hv missed something.. On 24 June 2010 22:49, Vivek Sundararajan <[email protected]> wrote: > 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]<algogeeks%[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.
