Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef LIST_H
- #define LIST_H
- #include "stdafx.h"
- template<class T> class Node
- {
- public:
- Node(T data) { entry = data; }
- T entry;
- Node * next;
- };
- template<class T> class List
- {
- Node<T> * head;
- Node<T> * tail;
- size_t length;
- public:
- List() { head = NULL; tail = NULL; length = 0; }
- void push_front(T);
- T pop_front();
- void push_back(T);
- T pop_back();
- };
- template<class T> class Stack
- {
- List<T> list;
- public:
- void push_front(T);
- T pop_front();
- };
- template<class T> class Queue
- {
- List<T> list;
- public:
- void push_back(T);
- T pop_back();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement