Back to all patterns

Tree DFS / BFS

1 problems • Practice on LeetCode to earn credits

About This Pattern

Master the Tree DFS / BFS pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.

Easy (1)

Maximum Depth of Binary Tree

Find the maximum depth of a binary tree.

Key Signals:

Recursively get max of subtreesAdd 1 for current levelBFS can count levels