104 Maximum Depth of Binary Tree
https://leetcode.com/problems/maximum-depth-of-binary-tree/
solution
时间复杂度:O(n) 空间复杂度:O(1)
follow-up
111. Minimum Depth of Binary Tree
BFS
时间复杂度:O() 空间复杂度:O()
DFS
时间复杂度:O(n) 空间复杂度:O(h)
Last updated
https://leetcode.com/problems/maximum-depth-of-binary-tree/
时间复杂度:O(n) 空间复杂度:O(1)
111. Minimum Depth of Binary Tree
BFS
时间复杂度:O() 空间复杂度:O()
DFS
时间复杂度:O(n) 空间复杂度:O(h)
Last updated