Binary TreesMaximum Depth of Binary Tree
Progress
solution.py
⌘↵ run
Loading...

Maximum Depth of Binary Tree

easy
You've got this! Start small, think out loud.

Given the root of a binary tree, return its maximum depth. The maximum depth is the number of nodes along the longest path from the root down to the farthest leaf.

Time:O(n)
Space:O(h)
recursiondfsgoogle-favorite
OUTPUT

Run your code to see output