Back
Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth.
Java
Description
Solution
My Code
Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth.
Example 1:
Input:
{"root":[3,9,20,null,null,15,7]}
Output:
3
Viz
Tests
Run
Input
Example 1
Example 2
Single
Empty
Custom
{"root":[3,9,20,null,null,15,7]}
arr =
{"root":[3,9,20,null,null,15,7]}
Depth
1
Max Depth
0
3
9
20
15
7
Variables
No variables to display
Depth
Function Call
Stack empty
0/26
0.5x
1x
2x
4x