Skip to content

Instantly share code, notes, and snippets.

@Ratstail91
Created March 12, 2013 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ratstail91/5142812 to your computer and use it in GitHub Desktop.
Save Ratstail91/5142812 to your computer and use it in GitHub Desktop.
Playing with a linked list
#ifndef LINKEDLIST_HPP_
#define LINKEDLIST_HPP_
class Node {
public:
Node() {
next = nullptr;
}
virtual ~Node() {}
virtual Node* GetNext() {
return next;
}
virtual Node* SetNext(Node* p) {
return next = p;
}
virtual bool operator<(Node&)=0;
virtual bool operator>(Node&)=0;
private:
node* next;
};
class LinkedList {
public:
LinkedList() {
head = nullptr;
tail = nullptr;
}
virtual ~LinkedList() {}
void PushFront(Node* p) {
//
}
void PushBack(Node* p) {
//
}
void PushFront(LinkedList* p) {
//
}
void PushBack(LinkedList* p) {
//
}
Node* PopFront(int count = 1) {
//
}
Node* PopBack(int count = 1) {
//
}
Node* Pop(int position, int count = 1) {
//
}
void Sort() {
//
}
void Shuffle() {
//
}
int Size() {
//
}
Node* begin() {
return head;
}
Node* end() {
return tail;
}
private:
Node* head;
Node* tail;
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment