FresherFresher (0–1 yrs)CodingPythonAmazonMicrosoft
Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth (number of nodes along the longest root-to-leaf path).
Answers use simple, clear English.
Time: O(n)Space: O(h)
Confidence
#tree#dfs