Advertisement
Guest User

Untitled

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