Question: 1.Write a recursive method to compare two Strings using alphabetical order as the natural order (case insensitive). The function should return an integer with the
1.Write a recursive method to compare two Strings using alphabetical order as the natural order (case insensitive).
The function should return an integer with the following convention:
s1 comes before s2 returns an integer less than 0
s1 == (or indistinguisable from) s2 returns 0
s1 comes after s2 returns an integer greater than 0
2.Write a recursive method that uses your compareTo(String, String) method to find the minimum (i.e. first by alphabetical order) String in an array of Strings, given the array and the number of strings in the array.
Hint: Use the above method signature to call a private, helper method that is recursive -
you can add more parameters to this helper method!
3. Write a JUnit test class that fully tests each of these two methods.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
