Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File Edit Options Buffers Tools C++ Help
- 1 #include "sets.h" |1 #ifndef CLASS_H
- 2 using namespace std; |2 #define CLASS_H
- 3 |3
- 4 SetInt::SetInt(void) |4 #include <iostream>
- 5 { |5 using namespace std;
- 6 head = new TimmyTom; |6
- 7 tail = new TimmyTom; |7 class SetInt
- 8 |8 {
- 9 head->next = tail; |9 public:
- 10 tail->prev = head; |10
- 11 |11 SetInt(void);
- 12 head->data = NULL; |12 ~SetInt(void);
- 13 head->prev = NULL; |13
- 14 tail->next = NULL; |14
- 15 tail->data = NULL; |15 bool addToSet(int intToAdd);
- 16 } |16 bool delFromSet(int intToDel);
- 17 |17 void showDataSet(void) const;
- 18 SetInt::~SetInt(void) |18 SetInt *mergeDataSet(SetInt list1, SetInt, list2);
- 19 { |19
- 20 TimmyTom *b00m = tail; |20 private:
- 21 while(b00m != head) { |21
- 22 b00m = tail->prev; |22 bool searchList(int exists) const;
- 23 delete b00m->next; |23
- 24 } |24 TimmyTom *unin(SetInt set1, SetInt set2);
- 25 delete b00m; |25 TimmyTom *inter(SetInt set1, SetInt set2);
- 26 } |26
- |27 struct TimmyTom {
- |28 int *data;
- |29 TimmyTom *next;
- |30 TimmyTom *prev;
- |31 }*head, *tail;
- |32 };
- |33
- |34 #endif
- |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement