Skip to content

Instantly share code, notes, and snippets.

@danielgospodinow
Created September 22, 2019 20:01
Show Gist options
  • Save danielgospodinow/f3a04f0762f77c0e01c2bdabf8a0397b to your computer and use it in GitHub Desktop.
Save danielgospodinow/f3a04f0762f77c0e01c2bdabf8a0397b to your computer and use it in GitHub Desktop.
Linked List Definition
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