File tree 1 file changed +14
-3
lines changed
src/main/java/com/ctci/treesandgraphs
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,17 @@ public static void main(String[] args) {
70
70
TreeNode treeRoot2 = new TreeNode (8 );
71
71
treeRoot2 .left = new TreeNode (6 );
72
72
System .out .println (isT2SubtreeOfT1 (treeRoot , treeRoot2 ));
73
+
74
+ /*
75
+ The sub-tree:
76
+
77
+ 2
78
+ /
79
+ 1
80
+ */
81
+ TreeNode treeRoot3 = new TreeNode (2 );
82
+ treeRoot3 .left = new TreeNode (1 );
83
+ System .out .println (isT2SubtreeOfT1 (treeRoot , treeRoot3 ));
73
84
74
85
/*
75
86
The sub-tree:
@@ -78,8 +89,8 @@ public static void main(String[] args) {
78
89
/
79
90
9
80
91
*/
81
- TreeNode treeRoot3 = new TreeNode (8 );
82
- treeRoot3 .left = new TreeNode (9 );
83
- System .out .println (isT2SubtreeOfT1 (treeRoot , treeRoot3 ));
92
+ TreeNode treeRoot4 = new TreeNode (8 );
93
+ treeRoot4 .left = new TreeNode (9 );
94
+ System .out .println (isT2SubtreeOfT1 (treeRoot , treeRoot4 ));
84
95
}
85
96
}
You can’t perform that action at this time.
0 commit comments