-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNode.hpp
50 lines (41 loc) · 856 Bytes
/
Node.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef NODE_HPP
#define NODE_HPP
#include <iostream>
// DO NOT CHANGE THIS FILE.
template<class T>
class Node
{
public:
T element;
Node<T> *prev;
Node<T> *next;
Node();
Node(T element, Node<T> *prev, Node<T> *next);
Node(const Node<T> &obj);
friend std::ostream &operator<<(std::ostream &os, const Node<T> &obj)
{
os << obj.element;
return os;
}
};
template<class T>
Node<T>::Node()
{
this->prev = NULL;
this->next = NULL;
}
template<class T>
Node<T>::Node(T element, Node<T> *prev, Node<T> *next)
{
this->element = element;
this->prev = prev;
this->next = next;
}
template<class T>
Node<T>::Node(const Node<T> &obj)
{
this->element = obj.element;
this->prev = obj.prev;
this->next = obj.next;
}
#endif //NODE_HPP