filmov
tv
How To Solve '104 Maximum Depth of Binary Tree' on LeetCode - JavaScript Easy

Показать описание
Do you need more help with coding?
════════════════════════════
Problem: 104 Maximum Depth of Binary Tree
Language: Javascript
Difficulty: Easy
This is only one possible solution and may not be the most optimal.
Pseudo Code:
1. if root is null, return 0
2. return the max of maxDepth(left) +1 or maxDepth(right) + 1
Time Complexity: O(n)
Space Complexity: O(n)
Let's Connect 💯:
════════════════════════════
════════════════════════════
Problem: 104 Maximum Depth of Binary Tree
Language: Javascript
Difficulty: Easy
This is only one possible solution and may not be the most optimal.
Pseudo Code:
1. if root is null, return 0
2. return the max of maxDepth(left) +1 or maxDepth(right) + 1
Time Complexity: O(n)
Space Complexity: O(n)
Let's Connect 💯:
════════════════════════════