-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntegerSet.h
48 lines (29 loc) · 1015 Bytes
/
IntegerSet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Keita Nonaka
//
// This is a header file for rational class
// This header is for declaring methods and variables.
//
#ifndef CS255_INTEGERSET_H
#define CS255_INTEGERSET_H
#include <vector>
using namespace std;
class IntegerSet {
private:
vector<bool> integerSet;
public:
IntegerSet(); // constructor
~IntegerSet(); // destructor
void initializeVT(); // integer set, initialize 101 sets as false
IntegerSet intersect (IntegerSet intset); // called by setC = setA.intersect(setB);
IntegerSet unionize(IntegerSet intset); //similar. Note 'union' is a C++ keyword
IntegerSet complement(); //''
IntegerSet difference(IntegerSet intset); //''
bool subset(IntegerSet intset); // called by if(setA.subset(setB))
bool isEmpty(); //similar
bool isEqualTo(IntegerSet intset); //''
void insertElement(int num); // called by setA.insertElement(k)
void deleteElement(int num); // similar
void printSet(); // print
};
#endif //CS255_INTEGERSET_H