Skip to content

Commit 56f0fa2

Browse files
committed
Added one more test case
1 parent 2a01fac commit 56f0fa2

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/main/java/com/ctci/treesandgraphs/CheckSubtree.java

+14-3
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)