Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef NODE_H
- #define NODE_H
- template <class T>
- class Node {
- public:
- Node(T val);
- ~Node();
- T val;
- Node* down;
- Node* up;
- };
- template <class T>
- Node<T>::Node(T val) {
- this->val = val;
- this->down = nullptr;
- this->up=nullptr;
- }
- template <class T>
- Node<T>::~Node() {
- if (this->down != nullptr) delete this->down;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement