#ifndef BSTDOTH #define BSTDOTH #include #include using namespace std; typedef string itemType; struct node { node *lchild, *rchild, *parent; itemType data; }; typedef node * position; class BST { public: BST(); // basic tree operators position root(); position parent(position); bool isInternal(position); bool isExternal(position); bool isRoot(position); int size(); void replaceElement(position, itemType); itemType element(position); // binary tree operators position leftChild(position); position rightChild(position); position sibling(position); // my operations bool hasLeftChild(position); bool hasRightChild(position); bool isNode(position); // BST operators position findElement(itemType); void insertItem(itemType); void removeElement(itemType); // helpful void inorderPrint(ostream & s); private: position theroot; int thesize; }; #endif