TeachJava! |
Morning:
Morning Laboratory:
Afternoon:
Afternoon Laboratory:
You are given the following informal data definition.
A BinaryTree is either:
int
; or
BinaryTree
at the apex
representing
the preceding data definition. The class should include
appropriate constructors and accessors for each concrete class and
appropriate definitions of the method toString()
method so that:
int
value c
toString()
forms for b1, b2
BinaryTreeVisitor
for the BinaryTree
composite hierarchy. Using this
interface, define visitors to compute:
BinaryTee
class or a separate Test
class.