104. Maximum Depth of Binary Tree
# Easy, DFS
Divide and Conquer, think from top to bottom
Solution:
Stop condition( is also called edge case because only one main function ):
root = None
Find max depth of left and right sub-tree
Return (max of left and right max depth + 1)
Last updated
Was this helpful?