Consider again the TreeNode
class of question 96df---the original class, not your set of improved classes.
Extend TreeNode
with a clone()
method that, when invoked on a TreeNode
instance, creates and returns a copy of the
subtree rooted at the given node. All aspects of a node should be cloned, apart from the key, which should not be
cloned. (Because of this, the result will not be a true "deep copy": the copy and the original will share the same key object.
Hence, this copy might actually be called "semi-deep".)