-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchainNode.cpp
More file actions
33 lines (25 loc) · 823 Bytes
/
chainNode.cpp
File metadata and controls
33 lines (25 loc) · 823 Bytes
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
#include "chainNode.h"
chainNode::chainNode() {
this->data.first = 0;
this->data.second = "";
this->next = nullptr;
}
chainNode::chainNode(pair<int, string> newData, chainNode* newNext) {
this->data = newData;
this->next = newNext;
}
chainNode::chainNode(pair<int, string> newData)
{
this->data = newData;
this->next = NULL;
}
chainNode::chainNode(const chainNode& secondNode) {
this->data = secondNode.data;
this->next = secondNode.next;
}
bool chainNode::operator==(const chainNode& second) const {
return this->data.first == second.data.first && this->data.second == second.data.second && this->next == second.next;
}
int chainNode::get_key()const { return this->data.first; }
string chainNode::get_value()const { return this->data.second; }
chainNode* chainNode::get_next()const { return this->next; }