Suppose an interface Visitor has a single method
void visit(Object obj)
void inOrder(Visitor v)
void preOrder(Visitor v)
void postOrder(Visitor v)
to the BinarySearchTree class. These methods should visit the tree nodes in the specified traversal order and apply the visit method to the data of the visited node.