104. Maximum Depth of Binary Tree

# Easy, DFS

Divide and Conquer, think from top to bottom

Solution:

  1. Stop condition( is also called edge case because only one main function ): root = None

  2. Find max depth of left and right sub-tree

  3. Return (max of left and right max depth + 1)

Last updated