- Definition 1: 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
.
Below is the public interface of the binary tree framework. Click here for javadoc documentation.
The implementation details are given in the following UML class diagram. Click here for javadoc documentation.