Sorting an array with two values
- by davit-datuashvili
I have array of colors:
String s[]=new String[]{"red","black..............};
The only possible colors are red and black. I need an algorithm which partitions the array such that all red come before all black. How can I compare/exchange them to accomplish that?