/*****************************************************************************

  CSE 235 - Discrete Mathematics
   Fall 2005
   set.cpp -- set class implementation file, see set.h for details

   Some methods have been implemented for you, most have not, you MUST
   implement ALL methods.

*************************************************************************/

#include "set.h"

//------------------------------------------------------------------------
set::set()
{
}

//------------------------------------------------------------------------
set::set(int n) 
{
}

//------------------------------------------------------------------------
set::~set() 
{  
}

//------------------------------------------------------------------------
set::set(const set &S)
{
}

//------------------------------------------------------------------------
set& set::operator =(const set &S) 
{
    if(this!=&S)
    {
        /*
          Note, you cannot simply call the set(S) constructor 
          since S is constant in this function.  Instead we have
          to copy all aspects of S directly.  
        */

    }
    return *this;
}

//------------------------------------------------------------------------
void set::init_set(int n) 
{
}

void set::AddElement(int x)
{
}

void set::TossElement(int x)
{
}

int set::GetElement(int index) const
{
}

int set::Cardinality() const
{
}

bool set::IsEmpty() const
{
}

bool set::IsIn(int x) const
{
}

//------------------------------------------------------------------------
// This function has been implemented for you                
istream& operator >>(istream &in, set &S) 
{          
  int n;
  int x;
  in >> n;         //inputs the size, n
  
  S.init_set(0);  //empties any pervious set, allocates enough
                   //memory
  for (int i = 0; i < n; i++)
  {
    in >> x;
    S.AddElement(x);
  }
  
  return in;
}

//---------------------------------------------------------------
// This function has been implemented for you           |
void set::read(char *thefile) 
{ 
    ifstream infile(thefile);
    infile>>*this;
    infile.close();
}

//---------------------------------------------------------------
ostream& operator <<(ostream &out, const set &S)      
{

   return out; // this should be the last thing in
               // this method.  Just leave it here.
}

//---------------------------------------------------------------
// This is already implemented for you--but you         |
// need to implement "<<" for it to work            |
void set::write(char *thefile) const 
{
    ofstream out(thefile);
    out<<*this;
    out.close();
}

set Union(set A, set B)
{
  set TheUnion;
  /* your code here to build this set */
  return TheUnion;
}

set Intersection(set A, set B)
{
}

set SetMinus(set A, set B)
{
}

set SymmDiff(set A, set B)
{
}

set SetProduct(set A, set B)
{
}

set SetSum(set A, set B)
{
}

bool IsSubset(set A, set B)
{
}


