Guest User

Untitled

a guest
Jul 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <class T>
  5. class Node {
  6. private:
  7.     Node* next; //next in the linked list
  8.     Node* prev; //previous in the linked list
  9. public:
  10.  
  11.     T data;
  12.    
  13.     Node () {
  14.         next = NULL;
  15.         prev = NULL;
  16.         T newData;
  17.         data = newData;
  18.     }
  19.    
  20.     void setPrev (Node* newPrev) {
  21.         prev = newPrev;
  22.     }
  23.  
  24.     Node* getPrev () {
  25.         return prev;
  26.     }
  27.  
  28.     void setNext (Node* newNext) {
  29.         next = newNext;
  30.     }
  31.  
  32.     Node* getNext () {
  33.         return next;
  34.     }
  35.    
  36. };
Add Comment
Please, Sign In to add comment