|
6 | 6 | importorg.junit.Test; |
7 | 7 |
|
8 | 8 | publicclass_116Test { |
9 | | -privatestatic_116.Solution1solution1; |
10 | | -privatestaticTreeLinkNoderoot; |
| 9 | +privatestatic_116.Solution1solution1; |
| 10 | +privatestatic_116.Solution2solution2; |
| 11 | +privatestaticTreeLinkNoderoot; |
11 | 12 |
|
12 | | -@BeforeClass |
13 | | -publicstaticvoidsetup() { |
14 | | -solution1 =new_116.Solution1(); |
15 | | - } |
| 13 | +@BeforeClass |
| 14 | +publicstaticvoidsetup() { |
| 15 | +solution1 =new_116.Solution1(); |
| 16 | +solution2 =new_116.Solution2(); |
| 17 | + } |
16 | 18 |
|
17 | | -@Test |
18 | | -publicvoidtest1() { |
19 | | -root =newTreeLinkNode(1); |
20 | | -root.left =newTreeLinkNode(2); |
21 | | -root.right =newTreeLinkNode(3); |
22 | | -root.left.left =newTreeLinkNode(4); |
23 | | -root.left.right =newTreeLinkNode(5); |
24 | | -root.right.right =newTreeLinkNode(7); |
| 19 | +@Test |
| 20 | +publicvoidtest1() { |
| 21 | +root =newTreeLinkNode(1); |
| 22 | +root.left =newTreeLinkNode(2); |
| 23 | +root.right =newTreeLinkNode(3); |
| 24 | +root.left.left =newTreeLinkNode(4); |
| 25 | +root.left.right =newTreeLinkNode(5); |
| 26 | +root.right.right =newTreeLinkNode(7); |
25 | 27 |
|
26 | | -solution1.connect(root); |
27 | | - } |
| 28 | +solution1.connect(root); |
| 29 | + } |
| 30 | + |
| 31 | +@Test |
| 32 | +publicvoidtest2() { |
| 33 | +root =newTreeLinkNode(1); |
| 34 | +root.left =newTreeLinkNode(2); |
| 35 | +root.right =newTreeLinkNode(3); |
| 36 | +root.left.left =newTreeLinkNode(4); |
| 37 | +root.left.right =newTreeLinkNode(5); |
| 38 | +root.right.right =newTreeLinkNode(7); |
| 39 | + |
| 40 | +solution2.connect(root); |
| 41 | + } |
28 | 42 | } |