// This is the header file set.h. This is the interface // for the class Set, which is a class for a generic set. #ifndef SET_H #define SET_H #include "listtools.h" using LinkedListSavitch::Node; namespace SetSavitch { template class Set { public: Set(); // Initialize empty set // Normally a copy constructor and overloaded assignment // operator would be included. They have been omitted // to save space. virtual ~Set(); // Destructor destroys set bool contains(T target) const; // Returns true if target is in the set, false otherwise void add(T item); // Adds a new element to the set void output(); // Outputs the set to the console Set* setUnion(const Set& otherSet); // Union calling object's set with otherSet // and return a pointer to the new set Set* setIntersection(const Set& otherSet); // Intersect calling object's set with otherSet // and return a pointer to the new set private: Node *head; }; // Set } // SetSavitch #endif // SET_H