Skip to content

Commit 616a7e5

Browse files
refactor Node
1 parent ebc7f88 commit 616a7e5

File tree

1 file changed

+20
-17
lines changed
  • src/main/java/com/fishercoder/common/classes

1 file changed

+20
-17
lines changed

src/main/java/com/fishercoder/common/classes/Node.java

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,28 @@
44
import java.util.List;
55

66
public class Node {
7-
public int val;
8-
public List<Node> children;
7+
public int val;
8+
public List<Node> children;
99

10-
public Node() {
11-
}
10+
public Node() {
11+
}
1212

13-
public Node(int val, List<Node> children) {
14-
this.val = val;
15-
this.children = children;
16-
}
13+
public Node(int val, List<Node> children) {
14+
this.val = val;
15+
this.children = children;
16+
}
1717

18-
public Node(int val) {
19-
this.val = val;
20-
this.children = new ArrayList<>();
21-
}
18+
public Node(int val) {
19+
this.val = val;
20+
this.children = new ArrayList<>();
21+
}
2222

23-
//todo: implement this method
24-
/**return a N-ary tree based on the preorder values*/
25-
public static Node createNaryTree(List<Integer> preorderValues) {
26-
return null;
27-
}
23+
//todo: implement this method
24+
25+
/**
26+
* return a N-ary tree based on the preorder values
27+
*/
28+
public static Node createNaryTree(List<Integer> preorderValues) {
29+
return null;
30+
}
2831
}

0 commit comments

Comments
 (0)