import java.util.*; public class WordMorph { static String[] words; // English dictionary (lowercase). static LinkedList> results; // The result. static LinkedList> findLinks (String startWord, String endWord, int numSteps) { // Read in the dictionary. words = WordTool.getDictionary(); results = new LinkedList>(); // INSERT PART OF YOUR CODE HERE to call the recursive method return results; } // INSERT YOUR CODE HERE (for the recursive method) static boolean offByOne (String word1, String word2) { // INSERT YOUR CODE HERE. // Return true if the two words are of the same length // and differ by exactly one letter. } // You might or might not find this method useful. static LinkedList copy (LinkedList list) { LinkedList copyList = new LinkedList(); for (String s: list) { copyList.add (s); } return copyList; } public static void main (String[] argv) { // Test LinkedList> results = findLinks ("east", "west", 4); print (results); // Test 2: results = findLinks ("lead", "gold", 4); print (results); // Test 3: results = findLinks ("cat", "dog", 4); print (results); } static void print (LinkedList> listOfLists) { int count = 0; for (LinkedList list: listOfLists) { for (String s: list) { System.out.print (" " + s); } System.out.println (); count ++; } System.out.println (" => " + count + " different morphs"); } }