Definition: Binary Tree
A (mutable) binary tree, BiTree, can be in an empty state or a non-empty state:
- When it is empty, it contains no data.
- When it is not empty, it contains a data object called the root element, and 2 distinct BiTree objects called the left subtree and the right subtree.
We implement the above object structure with a combination of state/composite/visitor patterns, in a manner analogous to LRStruct.
Download the source here:
Below is the public interface of the binary tree framework. Download the javadoc documentation here.
The implementation details are given in the following UML class diagram. Download the javadoc documentation here.