-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
43 lines (35 loc) · 749 Bytes
/
Node.java
File metadata and controls
43 lines (35 loc) · 749 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
public class Node {
private String value, initValue;
private Node top, left, right, bot;
public void initialize(int val, Node top, Node left, Node right, Node bot) {
this.value = Integer.toString(val);
this.initValue = Integer.toString(val);
this.top = top;
this.left = left;
this.right = right;
this.bot = bot;
}
public String swap(String value){
String hold = this.value;
this.value = value;
return hold;
}
public String getValue() {
return this.value;
}
public String getInitValue() {
return this.initValue;
}
public Node getTop() {
return this.top;
}
public Node getLeft() {
return this.left;
}
public Node getRight() {
return this.right;
}
public Node getBot() {
return this.bot;
}
}