add go solution

This commit is contained in:
程序员小贺
2021-05-16 12:56:30 +08:00
committed by GitHub
parent 5fe144aeb3
commit 58c9ffd751

View File

@ -140,7 +140,7 @@ func lengthOfLIS(nums []int ) int {
return len(dp)
}
```
复杂度分析
*复杂度分析*
- 时间复杂度O(nlogn)。数组 nums 的长度为 n我们依次用数组中的元素去更新 d 数组,而更新 d 数组时需要进行 O(logn) 的二分搜索,所以总时间复杂度为 O(nlogn)。
- 空间复杂度O(n),需要额外使用长度为 n 的 d 数组。