#ifndef SETS_H #define SETS_H struct BinTreeNode; typedef BinTreeNode *PBinTreeNode; class Set { public: Set (); ~Set(); Set& add(int); bool member (int) const; Set& clear(); int extent () const; private: int size; #ifdef TREE PBinTreeNode root; #else int members[100]; #endif }; /* 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 (); }; inline int Set::extent() const { return size; } #endif