Question: Program should be written recursively and with Java Modify the recursive definition of equals so that two strings are equalX if both strings have the

Program should be written recursively and with Java
Modify the recursive definition of equals so that two strings are equalX if both strings have the same number of X characters and those characters are in all the same positions in both strings. The strings may be different lengths, but the longer string can have no Xs in its extra length. For example, equalx( "X", "X" ) is true equalx( "aaaXaaaX", "abcXcbaX" ) is true equalx( "XaXbXcX", "XtXoXpXdef" ) is true equalX( "XaXbXcX", "XtXoXpXdXf" ) is false equalx( "XXXX", "XX" ) is false equalx( "aXaXbXcX", "XtXoXpX" ) is false 1. If StringA has no characters and StringB has no characters, then the strings ARE equalX. 2. If StringA has no characters and StringB has some characters, then o the strings are equalX if StringB has no Xs. o the strings are NOT equalX if StringB has any X. 3. If StringB has no characters and StringA has some characters, then o the strings are equalX if StringA has no Xs. o the strings are NOT equalX if StringA has any X. 4. If both strings have some characters, then o if the first character of both strings is X, then the strings are equalX if the tails are equalX. o if the first character of one string is X, but the first character of the other string is not X, then the strings are NOT equalX o if the first characters of both strings are not X, then the strings are equalX if the tails are equalX Click here to go back to the main menu
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
