Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #ifndef NODE_H
  2. #define NODE_H
  3.  
  4. template <class T>
  5. class Node {
  6. public:
  7. Node(T val);
  8. ~Node();
  9. T val;
  10. Node* down;
  11. Node* up;
  12. };
  13.  
  14. template <class T>
  15. Node<T>::Node(T val) {
  16. this->val = val;
  17. this->down = nullptr;
  18. this->up=nullptr;
  19. }
  20.  
  21. template <class T>
  22. Node<T>::~Node() {
  23. if (this->down != nullptr) delete this->down;
  24. }
  25.  
  26. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement