-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
50 lines (38 loc) · 801 Bytes
/
Node.java
File metadata and controls
50 lines (38 loc) · 801 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
39
40
41
42
43
44
45
46
47
48
49
50
package SplayTree;
public class Node<T extends Comparable<T>> {
private T data;
private Node<T> rightNode;
private Node<T> leftNode;
private Node<T> parentNode;
public Node(T data){
this.data = data;
}
public T getData() {
return data;
}
public void setData(T data) {
this.data = data;
}
public Node<T> getRightNode() {
return rightNode;
}
public void setRightNode(Node<T> rightNode) {
this.rightNode = rightNode;
}
public Node<T> getLeftNode() {
return leftNode;
}
public void setLeftNode(Node<T> leftNode) {
this.leftNode = leftNode;
}
public Node<T> getParentNode() {
return parentNode;
}
public void setParentNode(Node<T> parentNode) {
this.parentNode = parentNode;
}
@Override
public String toString() {
return this.data.toString();
}
}