-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathNode.java
49 lines (41 loc) · 1009 Bytes
/
Node.java
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
package hashtables;
/**
* Created by Prashant.
* We are using LinkedList to store the individual members of Hashmap.
* Each LinkedList has the "next" element which stores the chain of values having same keys,Which is necessary for
* resolving collision
*/
public class Node {
private String key;
private double value;
private Node next;
public HashList(String key,double value){
this.key=key;
this.value=value;
}
public double getValue(){
return value;
}
public void setValue(double value){
this.value=value;
}
public String getKey(){
return key;
}
public void setKey(String key){
this.key=key;
}
public Node getNext(){
return next;
}
public void setNext(Node next){
this.next=next;
}
@Override
public String toString() {
return "HashList{" +
"key='" + key + '\'' +
", value=" + value +
'}';
}
}