Skip to content

Commit 3731af0

Browse files
committed
change to list
1 parent 41533f8 commit 3731af0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

unique-binary-search-trees-ii/Solution.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
public class Solution {
1111

12-
1312
ArrayList<TreeNode> generateTrees(int[] array){
1413
if (array.length == 0) return new ArrayList<TreeNode>(Collections.<TreeNode>singletonList(null));
1514

@@ -32,14 +31,12 @@ ArrayList<TreeNode> generateTrees(int[] array){
3231
return found;
3332
}
3433

35-
36-
public ArrayList<TreeNode> generateTrees(int n) {
37-
// Note: The Solution object is instantiated only once and is reused by each test case.
38-
34+
public List<TreeNode> generateTrees(int n) {
35+
3936
int[] array = new int[n];
4037

4138
for(int i = 0; i < n ; i++) array[i] = i + 1;
4239

4340
return generateTrees(array);
4441
}
45-
}
42+
}

0 commit comments

Comments
 (0)