摘要:
``` /** * 104. Maximum Depth of Binary Tree * 1. Time:O(n) Space:O(h) * 2. Time:O(n) Space:O(h) * 3. Time:O(n) Space:O(h) */ // 1. Time:O(n) Space:O(h) class Solution { public int maxDepth(TreeNode ro 阅读全文
摘要:
```/** * 230. Kth Smallest Element in a BST * 1. Time:O(n) Space:O(n) * 2. Time:O(h+k) Space:O(h+k) * 3. Time:O(h+k) Space:O(h+k) */// 1. Time:O(n) Space:O(n)class Solution { public int kthSmal... 阅读全文