#include "BinaryNode.h" class BinaryTree { private: BinaryNode *root; friend class BinarySearchTree; static void deleteTree(BinaryNode *root); public: // class BinaryTree (cont) BinaryTree( ) { root = NULL; } BinaryTree(int el) { root = new BinaryNode(el); } ~BinaryTree() { deleteTree(root); root = NULL; } // functions BinaryNode *getRoot( ) { return root; } bool isEmpty( ) { return root == NULL; } int size( ) { return (root == NULL) ? 0 : root->size(root); } int height( ) { return (root == NULL) ? 0 : root->height(root); } void copy(BinaryTree& rhs) { if (this != &rhs) { deleteTree(root); // make tree empty if (rhs.root != NULL) root = rhs.root->copy(); } } };