Created
September 22, 2019 20:01
-
-
Save danielgospodinow/f3a04f0762f77c0e01c2bdabf8a0397b to your computer and use it in GitHub Desktop.
Linked List Definition
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T> | |
class LinkedList { | |
public: | |
LinkedList(); | |
void add(const T &item); | |
T get(int index) const; | |
void insert(const T &item, int index); | |
void remove(const T &item); | |
void removeAt(int index); | |
bool contains(const T &item) const; | |
int size() const; | |
void print() const; | |
private: | |
Node<T> *_head; | |
Node<T> *_tail; | |
int _size; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment