Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class T>
- class LinkedList
- {
- public:
- LinkedList(int capacity);
- ~LinkedList();
- const LinkedList& operator = (const LinkedList& right);
- LinkedList(const LinkedList& right);
- class Iterator : public std::iterator<std::bidirectional_iterator_tag, T>
- {
- public:
- Iterator(const LinkedList<T> &obj, int index);
- T& operator*();
- Iterator& operator++();
- Iterator& operator--();
- int GetIndex() const { return _copyIndex; };
- int *GetNext() const { return _copyNext; };
- private:
- int _copyIndex;
- int _copyPrevIndex;
- T *_copyItems;
- int *_copyNext;
- int *_copyPrev;
- };
- Iterator Add(T value);
- Iterator Insert(Iterator it, T value);
- private:
- T *_items;
- int *_next;
- int *_prev;
- int _index;
- int _prevIndex;
- int _deletedIndex;
- int _head;
- int _count;
- int _capacity;
- };
Add Comment
Please, Sign In to add comment