-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.java
More file actions
64 lines (53 loc) · 691 Bytes
/
Node.java
File metadata and controls
64 lines (53 loc) · 691 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package M;
public class Node {
Node right ; // right child
Node left ; // left child
String str ;
int num ;
Node(String str, int num)
{
this.str = str ;
this.num = num ;
right = null ;
left = null ;
}
Node(String str, int num, Node right, Node left)
{
this.str = str ;
this.num = num ;
this.right = right ;
this.left = left ;
}
void setStr(String s)
{
str = s ;
}
void setNum(int n)
{
num = n ;
}
String getStr()
{
return str ;
}
int getNum()
{
return num ;
}
void setRight(Node r)
{
right = r ;
}
void setLeft(Node l)
{
left = l ;
}
Node getRight()
{
return right ;
}
Node getLeft()
{
return left ;
}
}