I’m trying to bubble sort an array .
Example:
String str[]= {“ New Mexico, Santa Fe“, “Idaho, Boise”, “Nebraska, Lincoln”};
Output should be :
Boise Idaho
Lincoln Nebraska
Santa Fe New Mexico
I can bubble sort it Alphabetically by state. Can someone point me in the right direction to reverse the sort to do the second part of each string. Thanks