Implementation of the structure and functions of the tree.