Menu

[Solved]Bet One Figure Create Recursive Method Test Whether Partial String Subset Full String Par Q37105726

I bet No one can figure this out.

Create a Recursive Method to test whether a partial string is asubset of a full string. If the partial string is a subset of thefull string return true. Otherwise return false.Create a RecursiveMethod to test whether a partial string is a subset of a fullstring. If the partial string is a subset of the full string returntrue. Otherwise return false.

Here is the Main and Recursive below: (Note only needthe Recursive)

Main:

public class Chapter13Main {

   public static void main(String[] args){
       RecursiveContains rc = newRecursiveContains();

      System.out.println(rc.contains_recursive(“xd”, “thurtle”));// False

      System.out.println(rc.contains_recursive(“th”, “thurtle”)); //True

      System.out.println(rc.contains_recursive(“trl”, “thurtle”)); //True

      System.out.println(rc.contains_recursive(“utl”, “thurtle”)); //True

       // Strings are casesensitive
      System.out.println(rc.contains_recursive(“Tr”, “thurtle”)); //False

   }

}

Recursive:

public class RecursiveContains {

   /**
   * This method tests whether the first String the”partial” is a substring of
   * the “full” string. If the partial string containsall of the characters of
   * the full string in the same order return true. Elsereturn false. Example:
   * “tbl” “table” => true tbl appears in that orderin both strings
   *
   * “tlb” “table” => false tlb does not appear inthat order in the full string.
   *
   */
   public boolean contains_recursive(String partial,String full) {
       return false;
   }

}

Expert Answer


Answer to I bet No one can figure this out. Create a Recursive Method to test whether a partial string is a subset of a full strin… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *