Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- template <class T>
- class Node {
- private:
- Node* next; //next in the linked list
- Node* prev; //previous in the linked list
- public:
- T data;
- Node () {
- next = NULL;
- prev = NULL;
- T newData;
- data = newData;
- }
- void setPrev (Node* newPrev) {
- prev = newPrev;
- }
- Node* getPrev () {
- return prev;
- }
- void setNext (Node* newNext) {
- next = newNext;
- }
- Node* getNext () {
- return next;
- }
- };
Add Comment
Please, Sign In to add comment