Open Rajesh-1234567 opened 1 month ago
Given the root of a binary tree, write an algorithm to find its maximum depth.
root
[0, 10^4]
Input: 3 / \ 9 20 / \ 15 7 Output: 3 Explanation: The longest path is root -> 20 -> 7, which has 3 nodes.
Input: 1 \ 2 Output: 2 Explanation: The tree has a maximum depth of 2, since the longest path is root -> 2.
Input: None (Empty tree) Output: 0 Explanation: The tree is empty, so the maximum depth is 0.
Hey @indrakishore ! Kindly assign me this task.
plz assign this task to me and also add hactoberfest tag........
Given the
root
of a binary tree, write an algorithm to find its maximum depth.Input:
Output:
Constraints:
[0, 10^4]
.Example 1:
Example 2:
Example 3:
Hey @indrakishore ! Kindly assign me this task.