1. (15 points) Weiss exercise 6.2. You can just write the code for part (a) out by hand if you wish, but I recommend getting it working in Eclipse and printing out your code. Here is some code that you can use to test your method if you wish:
public static void main(String[] args) {
Collection<Collection<String>> a = new ArrayList<Collection<String>>();String[][] arrays = {{"abc", "def", "ghi"},
{"xyz", "uvw", "abc", "abc"},
{"a", "ab", "abc", "xyz", "abc"}};
for (String[] sArray : arrays){
Collection<String> a1 = new ArrayList<String>();
for (String s: sArray)
a1.add(s);
a.add(a1);
}
System.out.println(count(a, "abc"));
}
2. (5 points) Weiss exercise 6.4.