diff --git a/problems/108.convert-sorted-array-to-binary-search-tree.md b/problems/108.convert-sorted-array-to-binary-search-tree.md index e642a9f38..3e1a46f2b 100644 --- a/problems/108.convert-sorted-array-to-binary-search-tree.md +++ b/problems/108.convert-sorted-array-to-binary-search-tree.md @@ -172,7 +172,7 @@ class Solution(object): **复杂度分析** - 时间复杂度:$O(N)$ -- 空间复杂度:隐式调用栈的开销为 $O(N)$ +- 空间复杂度:由于是平衡二叉树,因此隐式调用栈的开销为 $O(logN)$ 更多题解可以访问我的 LeetCode 题解仓库:https://github.com/azl397985856/leetcode 。 目前已经 37K star 啦。 diff --git a/thinkings/bit.md b/thinkings/bit.md index 00d6fe705..0b1b60d5d 100644 --- a/thinkings/bit.md +++ b/thinkings/bit.md @@ -192,11 +192,12 @@ class Solution: ## 相关题目 -- [number-of-1-bits](https://leetcode-cn.com/problems/number-of-1-bits/) -- [counting-bits](https://leetcode-cn.com/problems/counting-bits/) -- [reverse-bits](https://leetcode-cn.com/problems/reverse-bits/) +- [190. 颠倒二进制位](https://leetcode-cn.com/problems/reverse-bits/)(简单) +- [191. 位1的个数](https://leetcode-cn.com/problems/number-of-1-bits/)(简单) +- [338. 比特位计数](https://leetcode-cn.com/problems/counting-bits/)(中等) +- [1072. 按列翻转得到最大值等行数](https://leetcode-cn.com/problems/flip-columns-for-maximum-number-of-equal-rows/)(中等) -更多题解可以访问我的LeetCode题解仓库:https://github.com/azl397985856/leetcode 。 目前已经30K star啦。 +更多题解可以访问我的LeetCode题解仓库:https://github.com/azl397985856/leetcode 。 目前已经38K star啦。 关注公众号力扣加加,努力用清晰直白的语言还原解题思路,并且有大量图解,手把手教你识别套路,高效刷题。 diff --git a/thinkings/island.md b/thinkings/island.md index a5d622b70..e4ca55cce 100644 --- a/thinkings/island.md +++ b/thinkings/island.md @@ -66,9 +66,9 @@ for i in range(M): ## 相关题目 - [200. 岛屿数量](https://github.com/azl397985856/leetcode/blob/master/problems/200.number-of-islands.md) -- [695. 岛屿的最大面积](https://leetcode-cn.com/problems/max-area-of-island/solution/695-dao-yu-de-zui-da-mian-ji-dfspython3-by-fe-luci/) +- [695. 岛屿的最大面积](https://leetcode-cn.com/problems/max-area-of-island/solution/695-dao-yu-de-zui-da-mian-ji-dfspython3-by-fe-luci/)(字节跳动原题) - [1162. 地图分析](https://leetcode-cn.com/problems/as-far-from-land-as-possible/solution/python-tu-jie-chao-jian-dan-de-bfs1162-di-tu-fen-x/) -- 463. 岛屿的周长 +- 463.岛屿的周长 上面四道题都可以使用常规的 DFS 来做。 并且递归的方向都是上下左右四个方向。更有意思的是,都可以采用原地修改的方式,来减少开辟 visited 的空间。