interface BinaryTree { Node left(TreeType t, Node node); Node right(TreeType t, Node node); } interface BinaryTreeWithRoot : BinaryTree { Node root(TreeType t); } interface BinaryTreeWithParentLink : BinaryTree { Node parent(TreeType t, Node node); } // Now an implementation of the Subtree. // The subtree object won't be tied to a specific BinaryTree. class Subtree : BinaryTreeWithRoot, Tree where Tree : BinaryTree { // During initialization, initialize the root as a node from the tree. public Subtree(Node root); Node root; override BinaryTreeWithRoot.root(TreeType t) { return this.root; } }