Also as in COMP 210, there are many other variants of trees. One that we won't use in COMP 212 is worth at least a mention. If we want a tree with arbitrary branching, each tree node can have a list of child trees. Thus, we could have a tree class that also used a list class. List the fields needed for these two classes in order to see that they are indeed different, and thus can't be combined.
Exercises Write the following visitors on binary trees.
Make any helper visitors be inner classes. If the host is empty, it returns the empty tree. InOrderEnumeration , which also implements Enumeration . Let InorderEnumeration have a local stack field. PostOrderEnumeration , which also implements Enumeration .