Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Base case returns 0 for null. For non-null node, return 1 + max depth from either subtree.
The deepest path must come from either left or right subtree plus the current node.
Updated Feb 2026