File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
yoonexample/src/main/java/tree/binarytree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ package tree .binarytree ;
2
+
3
+ public class BinaryTreeNodeImpl <E > implements BinaryTreeNode <E > {
4
+
5
+ private final E data ;
6
+ private BinaryTreeNode <E > left ;
7
+ private BinaryTreeNode <E > right ;
8
+
9
+ public BinaryTreeNodeImpl (E data ) {
10
+ this .data = data ;
11
+ }
12
+
13
+ @ Override
14
+ public E getData () {
15
+ return this .data ;
16
+ }
17
+
18
+ @ Override
19
+ public BinaryTreeNode <E > getLeftSubTree () {
20
+ return this .left ;
21
+ }
22
+
23
+ @ Override
24
+ public void setLeftSubTree (BinaryTreeNode <E > subTree ) {
25
+ this .left = subTree ;
26
+ }
27
+
28
+ @ Override
29
+ public BinaryTreeNode <E > getRightSubTree () {
30
+ return this .right ;
31
+ }
32
+
33
+ @ Override
34
+ public void setRightSubTree (BinaryTreeNode <E > subTree ) {
35
+ this .right = subTree ;
36
+ }
37
+ }
You can’t perform that action at this time.
0 commit comments