This commit is contained in:
CyC2018 2019-05-14 17:03:17 +08:00
commit 8904b56821
3 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<div align="center"> <div align="center">
<a href="https://github.com/CyC2018/CS-Notes/blob/master/other/download.md">离线阅读版本下载</a> <a href="https://github.com/CyC2018/CS-Notes/blob/master/other/download.md"><strong>离线阅读版本下载</strong></a>
</div> </div>
<br> <br>

View File

@ -257,7 +257,7 @@ public int findMin(int[] nums) {
## 6. 查找区间 ## 6. 查找区间
[34. Search for a Range (Medium)](https://leetcode.com/problems/search-for-a-range/description/) [34. Find First and Last Position of Element in Sorted Array (Medium)](https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/)
```html ```html
Input: nums = [5,7,7,8,8,10], target = 8 Input: nums = [5,7,7,8,8,10], target = 8

View File

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