File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
src/main/java/com/ctci/treesandgraphs Expand file tree Collapse file tree 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) {
7070 TreeNode treeRoot2 = new TreeNode (8 );
7171 treeRoot2 .left = new TreeNode (6 );
7272 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 ));
7384
7485 /*
7586 The sub-tree:
@@ -78,8 +89,8 @@ public static void main(String[] args) {
7889 /
7990 9
8091 */
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 ));
8495 }
8596}
You can’t perform that action at this time.
0 commit comments