I need some help, I need to write an algorithm to compare two strings and return -1 is the first string comes before the second one or 1 if the second comes before the first or 0 if they are equal. I can't figure out what to do this with recursion. Any help will be appreciated
you can use chartAt to compare(>, <) each character in the String
Thats what I am thinking, but I can't determine what the base case would be.
0 length String?
erm... you've looked at at the source code for String.compareTo(), right...?
public static void main(String args)
String first = "ramya";
String second = "sivakanth";
String third ="ramya";