-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashNode.h
More file actions
38 lines (29 loc) · 805 Bytes
/
HashNode.h
File metadata and controls
38 lines (29 loc) · 805 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
34
35
36
37
38
#ifndef MY_HASH_NODE
#define MY_HASH_NODE
using namespace std;
class HashNode {
unsigned long key; // The hash node's key
unsigned long value; // The key's associated data
/* extend if necessary */
public:
// Add constructors, destructor if necessary
//HashNode(unsigned long key, unsigned long value);
HashNode();
unsigned long getKey() { return key; }
unsigned long getValue() { return value; }
void assign(unsigned long key, unsigned long value);
// extend if necessary
};
/*
Implement the assign method
and any methods that you may additionally need for the HashTable to work.
*/
HashNode::HashNode() {
this->key = 0;
this->value = 0;
}
void HashNode::assign(unsigned long key, unsigned long value) {
this->key = key;
this->value = value;
}
#endif