Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * List.h
- *
- */
- #pragma once
- #include <iostream>
- #include <string>
- class List {
- private:
- class Node {
- public:
- Node() : data(0), next(nullptr), previous(nullptr){}
- Node(int data) : data(data), next(nullptr), previous(nullptr){}
- Node(const Node& node) {}
- ~Node();
- int data;
- Node* next;
- Node* previous;
- };
- Node* head;
- Node* tail;
- int n; // Rozmiar listy
- public:
- List() :
- head(nullptr), tail(nullptr), n(0) {
- }
- List(const List& list) {}
- virtual ~List();
- void push_front(int object);
- void pop_front();
- void push_back(int obiekt);
- void pop_back();
- void insert(int index, int object);
- void erase(int index);
- void swap(int index1, int index2);
- int size();
- int get_index_of(const int object);
- Node& get_node_ref(int index);
- Node* get_node_ptr(int index);
- void save_to_file(std::string file_name);
- void load_from_file(std::string file_name);
- // Operatory
- //bool operator==(const List &L);
- //List& operator=(const List &L);
- int& operator[](int index);
- };
Advertisement
Add Comment
Please, Sign In to add comment