-
Notifications
You must be signed in to change notification settings - Fork 0
/
Node.java
54 lines (38 loc) · 995 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
50
51
52
53
54
package HW4B;
public class Node {
private Object key;
private Node leftChild, rightChild, parent;
public Node() {
}
public Node (Object newKey, Node newParent, Node newRightChild,
Node newLeftChild) {
key = newKey;
parent = newParent;
rightChild = newRightChild;
leftChild = newLeftChild;
}
public Object key () {
return key;
}
public void setKey (Object newKey) {
key = newKey;
}
public Node getParent () {
return parent;
}
public void setParent (Node newParent) {
parent = newParent;
}
public Node getLeftChild () {
return leftChild;
}
public void setLeftChild (Node newLeftChild) {
leftChild = newLeftChild;
}
public Node getrightChild () {
return rightChild;
}
public void setRightChild (Node newRightChild) {
leftChild = newRightChild;
}
}