Part A

This part of the homework is about learning to use the List interface (and the classes LinkedList and ArrayList), and iterators on collections. The task is to write the code for the three generic methods union, intersection, and addToList in here. What those methods are supposed to do is specified as comments to these methods. The invocation of these methods within main should clarify the picture further.

Part B

Complete the MyTree class here that implements the Tree interface. The latter interface is the one in code fragment 7.1 of the text. I have basically reproduced it, but removed the exceptions, that you don't need to handle. Thus, what you need to do is add to the MyTree class the methods specified in the Tree interface. (I have already added the size() method.)

For the purpose of testing, I have added some code in the main method that creates part of the tree in Figure 7.2 of the text.

Submit the source files for Part A into a dropbox in ICON called Homework7, and for Part B into a dropbox in ICON called Homework8. These assignments are due by 11:59 pm on Monday, Nov 7.