#include <iostream>
#include <cassert>
#include "set.h"

using namespace std;

namespace uprm_icom4035 {
  // constructor based on size
  template<typename Item>
  set<Item>::set(int init_capacity){
    assert(init_capacity >= 1);
    elems = vector<value_type>(0);

  }
  

  // Union assignment operator
  template <typename Item>
  const set<Item>& set<Item>::operator+=(const set<Item>& b){
    int i = 0, len = 0;
    
    len = b.size();
    for (i=0; i < len; ++i){
      if (!find(b.elems[i])){
	elems.push_back(b.elems[i]);
      }
    }
    return *this;
  }
  
  template <typename Item>
  const set<Item>& set<Item>::operator-=(const set<Item>& b){
    int i = 0, len = 0;
    
    len = b.size();
    for (i=0; i < len; ++i){
      if (this->find(b.elems[i])){
	this->erase(b.elems[i]);
      }
    }
    return *this;
  }
  
  // get the size of the set
  template <typename Item>
  int set<Item>::size() const {
    // ADD YOUR CODE HERE
    return 0;
  }
  
  template <typename Item>
  bool set<Item>::empty_set() const{
    // ADD YOUR CODE HERE
    return true;
  }
  
  template <typename Item>
  bool set<Item>::sub_set(const set<Item>& s) const{
    // ADD YOUR CODE HERE
    return true;
  
  }
 
  // print the set
  template <typename Item>
  void set<Item>::print(ostream& out) const {
    int i = 0, len = 0;
    
    len = this->size();
    out << "{ ";
    for (i=0; i < len; ++i){
      out << this->elems[i] << " ";
    }
    out << "}";
    
    return;
  }
  
  
  // find an object in set
  template <typename Item>
  bool set<Item>::find(const value_type& obj) const{
    // ADD YOUR CODE HERE
    
    return false;
  }
  
  // add a new element to the set
  template <typename Item>
  void set<Item>::insert(const value_type& obj){
    // ADD YOUR CODE HERE
  }
  
  
  template <typename Item>
  bool set<Item>::erase(const value_type& obj){
    // ADD YOUR CODE HERE
    return false;
    
  }
  
  
  template <typename Item>
  set<Item> operator+(const set<Item>& b1, const set<Item>& b2){
    
    // ADD YOUR CODE HERE
    set<Item> result;
    return result;
  }
  
  template <typename Item>
  set<Item> operator-(const set<Item>& b1, const set<Item>& b2){

    // ADD YOUR CODE HERE
    set<Item> result;
    return result;
  }
  
  template <typename Item>
  set<Item> operator&(const set<Item>& b1, const set<Item>& b2){
    // ADD YOUR CODE HERE
    set<Item> result;
    return result;
  }
}
