- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathNode.java
More file actions
Latest commit
23 lines (22 loc) · 473 Bytes
/
Copy pathNode.java
File metadata and controls
23 lines (22 loc) · 473 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
packagecom.codinginterview.dsa;
publicclassNode<TextendsComparable<T>> {
privateTdata;
privateNode<T> next;
publicNode(Tdata){
this.data = data;
setNext(null);
}
publicNode<T> getNext(){
returnnext;
}
publicvoidsetNext(Node<T> next){
this.next = next;
}
publicTgetData(){
returndata;
}
@Override
publicStringtoString(){
returnString.valueOf(data);
}
}