|
A tree is either empty or has three parts: a root node containing one value, a left subtree and a right subtree.
Nondestructive functions on trees are typically defined using recursion where there is a case for an empty tree (NULL) and at least one case for a nonempty tree. Often, a function on a nonempty tree calls itself on the left and right subtrees.
|