This commit is contained in:
fighter
2019-05-11 19:45:39 +08:00
parent e2c271f270
commit 9226901705
2 changed files with 4 additions and 1 deletions

View File

@ -77,6 +77,9 @@ The above output corresponds to the 5 unique BST's shown below:
```java
public List<TreeNode> generateTrees(int n) {
if(n < 1){
return new LinkedList<TreeNode>();
}
return generateSubtrees(1, n);
}