Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 3 Java A nonrecursive method that starts the recursion for the filtering step. This method will take a list of Strings, consisting of the
Lab 3 Java
- A nonrecursive method that starts the recursion for the filtering step. This method will take a list of Strings, consisting of the anagrams, as its argument. Use a loop that takes each String in the list, converts it to an array of Strings using String's split() method with a blank space as the argument, and then uses the array to provide values for a list of Strings. The result of this will be a list of Strings in which each String is a word from the anagram. Still inside the loop, call the recursive filter method for each of these Strings. In each case when it receives a non-null String as the return value fo the recursive filter method, it will add the String to the list which it returns.
- A recursive filter method that takes a list of Strings and returns the following:
- if all of the Strings in the list are contained in the list of valid words, return a single String made up of the Strings in the order in which they appear in the list
- if any of the Strings in the list do not appear in the list of valid words, return null. This should be much more common than the first case.
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