Question: Java Mo Word-2120,HwARx+ rsion.pdt CSCI 2120 Homework 4: Recursion Introduction For this assignment you will implemsent two recursive methods and write JUnit tests for h
Mo Word-2120,HwARx+ rsion.pdt CSCI 2120 Homework 4: Recursion Introduction For this assignment you will implemsent two recursive methods and write JUnit tests for h one. You may write all three methods in the same class file. You are required to wriae lavadoc-style dacumentation for all of your methodk, incluxling the test methods Procedure 1) Write a recursive method to compare two Strings using alphabetical order as the natural order (case insensitive). DO NOT use the String class' built-in compare To method (50 points) public static int conpareTo(String s1, String s2) The function should return an integer with the following convention s1 comes belore s2 rctums an integer less than retums 0 s for indistinguisable from) s2 s1 comes after s2 retums an integer greater than 0 Hint: look into the methods charAtlint indenx) and substringlint beginindex) at hitps:/docs.oracle.com/javase/7/docapil/java/lang/String html 2) Write a recursive method that uses your compareTolString, String) method to find the minismum ti.e. first by alphabetical order) String in an array of Strings, given the array and the number of strings in the array: 50 points public statie String findinuCArrayist-Strine stringArray) or public statte String findHinimum(StringC stringirray, int numStrings) Hint: Use the above method signafure to call a private, helper method that is recursive you can add extra parameters to this helper methodt 3) Write a JUnit test class that fully tests each of these two methods. Bonus and submission/grading guidelines on nest page)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
