Skip to content

Commit f68720e

Browse files
refactor 536
1 parent 35082f7 commit f68720e

File tree

1 file changed

+0
-23
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-23
lines changed

Diff for: src/main/java/com/fishercoder/solutions/_536.java

-23
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,6 @@
55
import java.util.ArrayDeque;
66
import java.util.Deque;
77

8-
/**
9-
* 536. Construct Binary Tree from String
10-
*
11-
* You need to construct a binary tree from a string consisting of parenthesis and integers.
12-
The whole input represents a binary tree. It contains an integer followed by zero, one or two pairs of parenthesis.
13-
The integer represents the root's value and a pair of parenthesis contains a child binary tree with the same structure.
14-
You always start to construct the left child node of the parent first if it exists.
15-
16-
Example:
17-
Input: "4(2(3)(1))(6(5))"
18-
Output: return the tree root node representing the following tree:
19-
20-
4
21-
/ \
22-
2 6
23-
/ \ /
24-
3 1 5
25-
26-
Note:
27-
There will only be '(', ')', '-' and '0' ~ '9' in the input string.
28-
An empty tree is represented by "" instead of "()".
29-
*/
30-
318
public class _536 {
329

3310
public static class Solution1 {

0 commit comments

Comments
 (0)