Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //IntegerSet.h
- #ifndef INTEGERSET_H
- #define INTEGERSET_H
- #include <vector>
- #include <iostream>
- #include <stdexcept>
- #include <sstream>
- class IntegerSet
- {
- public:
- IntegerSet();
- IntegerSet(std::vector<int>); //constructor that takes an array of integers and initializes the set object to it
- ~IntegerSet();
- std::vector<bool> getNums() { return nums; }
- void Setboolset(std::vector<bool> val) { nums = val; }
- //other functions to be added...
- IntegerSet unionOfSets (IntegerSet); //element is true if true in either set; element is false if false in both sets
- void push (int); //adds a new number to nums
- void knock (int, int); //insert element = knock
- void printSet(); //prints out a set
- IntegerSet intersectionOfSets (IntegerSet); //intersection of two sets, outputs a set only true where both sets are true
- void deleteNum (int loc);//delete element sets given pos to 0
- std::string toString(); //toString returns the set as numbers separated by spaces, look at ostring for implementation
- bool isEqualTo (IntegerSet);//isEqualTo returns true if both sets are equal
- private:
- std::vector<bool> nums;
- };
- #endif // INTEGERSET_H
Add Comment
Please, Sign In to add comment