class Set
{
private:
struct Node
{
EType Item; // User data item
Node * Succ; // Link to the node's successor
};
unsigned Num; // Number of user data items in the set
Node * Head; // Link to the head of the chain
public:
// Return information about the set
//
bool is_empty() const { return Num == 0; }
unsigned size() const { return Num; }
// Initialize the set to empty
//
Set();
// De-initialize the set
//
~Set();
// Initialize the set using an existing set
//
Set( const Set& );
// Assign into the set from another set
//
Set& operator=( const Set& );
// Test for presence of a specified item in the set
//
bool is_present( const EType& ) const;
// Remove a specified item from the set, if possible
//
bool remove( EType& );
// Insert a specified item into the set, if possible
//
bool insert( const EType& );
// Display the contents of the set
//
void write( ostream& ) const;
// Produce the union of two sets
//
friend Set operator+( const Set&, const Set& );
// Produce the intersection of two sets
//
friend Set operator^( const Set&, const Set& );
// Produce the difference of two sets
//
friend Set operator-( const Set&, const Set& );
};
#endif
Tell me if anything else is needed for you to assist me...