Advertisement
Neveles

Untitled

Jan 20th, 2020
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #ifndef LIST_H
  2. #define LIST_H
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. class List
  8. {
  9. private:
  10.     struct Node
  11.     {
  12.         int value_;
  13.         Node* next_;
  14.         Node(int value = 0, Node * next = nullptr) : value_(value), next_(next) {};
  15.     };
  16.     Node* head_;
  17.     Node* tail_;
  18.     int minValue_;
  19.     void clear();
  20.  
  21. public:
  22.     List();
  23.     ~List();
  24.     List(List&& old) noexcept;
  25.     friend ostream& operator<< (std::ostream& out, const List& list);
  26.     void operator+(int value);
  27.     void operator+=(int value);
  28.     void removeMinimal();
  29.     void removeRepeats();
  30.     void removeLess();
  31.     void reduce();
  32.     void insert(const List& other);
  33.     void insertSorted(int value);
  34.     void joinSorted(const List& other);
  35. };
  36. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement