bwukki

Untitled

Apr 16th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.25 KB | None | 0 0
  1. //IntegerSet.h
  2. #ifndef INTEGERSET_H
  3. #define INTEGERSET_H
  4. #include <vector>
  5. #include <iostream>
  6. #include <stdexcept>
  7. #include <sstream>
  8.  
  9. class IntegerSet
  10. {
  11.     public:
  12.         IntegerSet();
  13.         IntegerSet(std::vector<int>); //constructor that takes an array of integers and initializes the set object to it
  14.         ~IntegerSet();
  15.  
  16.         std::vector<bool> getNums() { return nums; }
  17.         void Setboolset(std::vector<bool> val) { nums = val; }
  18.  
  19.         //other functions to be added...
  20.         IntegerSet unionOfSets (IntegerSet); //element is true if true in either set; element is false if false in both sets
  21.         void push (int); //adds a new number to nums
  22.         void knock (int, int); //insert element = knock
  23.         void printSet(); //prints out a set
  24.         IntegerSet intersectionOfSets (IntegerSet); //intersection of two sets, outputs a set only true where both sets are true
  25.         void deleteNum (int loc);//delete element sets given pos to 0
  26.         std::string toString(); //toString returns the set as numbers separated by spaces, look at ostring for implementation
  27.         bool isEqualTo (IntegerSet);//isEqualTo returns true if both sets are equal
  28.     private:
  29.         std::vector<bool> nums;
  30. };
  31.  
  32. #endif // INTEGERSET_H
Add Comment
Please, Sign In to add comment