Data Structures and Algorithms
with Object-Oriented Design Patterns in C# |
The BinaryTree class has three fields--key, left, and right. The first, key, represents the root node of the tree. The latter two, represent the left and right subtrees of the given tree. All three fields are null if the node represents the empty tree. Otherwise, the tree must have a root and two subtrees. Consequently, all three fields are non-null in a non-empty node.