#ifndef TREE_SET_H #define TREE_SET_H #include "set.h" struct BinTreeNode; typedef BinTreeNode *PBinTreeNode; class TreeSet: public Set { public: TreeSet (); Set& add(int); bool member (int) const; Set& clear(); private: PBinTreeNode root; void copyMembers (Set& into) const; }; /* In C++ a struct is similar to a class but is used for storing related data together. Structs are implemented almost exactly like clases, but the word struct replaces the word class. The only difference between a struct and a class in C++ is that by default data and fucntions in a struct are public, whereas the default in a class is that everything is private. */ struct BinTreeNode { int data; BinTreeNode *left, *right; static unsigned long counter; BinTreeNode (int d); ~BinTreeNode (); }; #endif