Skip to content

Commit be7ba86

Browse files
refactor 114
1 parent 1726cc3 commit be7ba86

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

src/main/java/com/fishercoder/solutions/_114.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
2 5
1616
/ \ \
1717
3 4 6
18+
1819
The flattened tree should look like:
1920
1
2021
\
@@ -49,5 +50,4 @@ public void flatten(TreeNode root) {
4950
}
5051
}
5152
}
52-
53-
}
53+
}

src/test/java/com/fishercoder/_114Test.java

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@
99
import java.util.Arrays;
1010

1111
public class _114Test {
12-
private static _114.Solution1 solution1;
13-
private static TreeNode root;
12+
private static _114.Solution1 solution1;
13+
private static TreeNode root;
1414

15-
@BeforeClass
16-
public static void setup() {
17-
solution1 = new _114.Solution1();
18-
}
15+
@BeforeClass
16+
public static void setup() {
17+
solution1 = new _114.Solution1();
18+
}
1919

20-
@Test
21-
public void test1() {
22-
root = TreeUtils.constructBinaryTree(Arrays.asList(1, 2, 5, 3, 4, null, 6));
23-
TreeUtils.printBinaryTree(root);
24-
solution1.flatten(root);
25-
TreeUtils.printBinaryTree(root);
26-
}
27-
28-
}
20+
@Test
21+
public void test1() {
22+
root = TreeUtils.constructBinaryTree(Arrays.asList(1, 2, 5, 3, 4, null, 6));
23+
TreeUtils.printBinaryTree(root);
24+
solution1.flatten(root);
25+
TreeUtils.printBinaryTree(root);
26+
}
27+
}

0 commit comments

Comments
 (0)