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].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to