-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTreeNode.java
More file actions
44 lines (35 loc) · 774 Bytes
/
TreeNode.java
File metadata and controls
44 lines (35 loc) · 774 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
package com.cpucode.tree;
/**
* @author : cpucode
* @date : 2021/6/8
* @time : 18:48
* @github : https://github.com/CPU-Code
* @csdn : https://blog.csdn.net/qq_44226094
*/
public class TreeNode {
public int val = 0;
public TreeNode left = null;
public TreeNode right = null;
public TreeNode(){}
public TreeNode(int val){
this.val = val;
}
public int getVal() {
return val;
}
public void setVal(int val) {
this.val = val;
}
public TreeNode getLeft() {
return left;
}
public void setLeft(TreeNode left) {
this.left = left;
}
public TreeNode getRight() {
return right;
}
public void setRight(TreeNode right) {
this.right = right;
}
}