Question
Write a method that adds all subsets of the letters in its first argument, str, to the ArrayList that is its second argument. For example,
Write a method that adds all subsets of the letters in its first argument, str, to the ArrayList that is its second argument. For example, generateSubstrings("ABC", result) adds to result the strings: "", "A", "B", "C", "AB", "AC", "BC'', "ABC" The order of the strings does not matter. In your test code, you will probably want a helper method that prints all of the strings in an 2 ArrayList. You may use iteration in any way you see fit for this problem. Do not worry too much about eliminating all memory allocation in this method. Demonstrate that your program works by printing to the console the source string and the subset, followed by the result. Call the primary source file SubstringFinder.java
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started