|
6 | 6 | import org.junit.Test;
|
7 | 7 |
|
8 | 8 | public class _116Test {
|
9 |
| - private static _116.Solution1 solution1; |
10 |
| - private static TreeLinkNode root; |
| 9 | + private static _116.Solution1 solution1; |
| 10 | + private static _116.Solution2 solution2; |
| 11 | + private static TreeLinkNode root; |
11 | 12 |
|
12 |
| - @BeforeClass |
13 |
| - public static void setup() { |
14 |
| - solution1 = new _116.Solution1(); |
15 |
| - } |
| 13 | + @BeforeClass |
| 14 | + public static void setup() { |
| 15 | + solution1 = new _116.Solution1(); |
| 16 | + solution2 = new _116.Solution2(); |
| 17 | + } |
16 | 18 |
|
17 |
| - @Test |
18 |
| - public void test1() { |
19 |
| - root = new TreeLinkNode(1); |
20 |
| - root.left = new TreeLinkNode(2); |
21 |
| - root.right = new TreeLinkNode(3); |
22 |
| - root.left.left = new TreeLinkNode(4); |
23 |
| - root.left.right = new TreeLinkNode(5); |
24 |
| - root.right.right = new TreeLinkNode(7); |
| 19 | + @Test |
| 20 | + public void test1() { |
| 21 | + root = new TreeLinkNode(1); |
| 22 | + root.left = new TreeLinkNode(2); |
| 23 | + root.right = new TreeLinkNode(3); |
| 24 | + root.left.left = new TreeLinkNode(4); |
| 25 | + root.left.right = new TreeLinkNode(5); |
| 26 | + root.right.right = new TreeLinkNode(7); |
25 | 27 |
|
26 |
| - solution1.connect(root); |
27 |
| - } |
| 28 | + solution1.connect(root); |
| 29 | + } |
| 30 | + |
| 31 | + @Test |
| 32 | + public void test2() { |
| 33 | + root = new TreeLinkNode(1); |
| 34 | + root.left = new TreeLinkNode(2); |
| 35 | + root.right = new TreeLinkNode(3); |
| 36 | + root.left.left = new TreeLinkNode(4); |
| 37 | + root.left.right = new TreeLinkNode(5); |
| 38 | + root.right.right = new TreeLinkNode(7); |
| 39 | + |
| 40 | + solution2.connect(root); |
| 41 | + } |
28 | 42 | }
|
0 commit comments