← 返回 linkedin 的题目列表Maximum Depth of a Binary Tree Algorithm
类型:online_judge
linkedin
Given a binary tree, write an algorithm to calculate its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the furthest leaf node.
Example:
Input: [3,9,20,null,null,15,7]
Output: 3
You should consider the range of node numbers from 0 to 10^4.
Example
Input
3,9,20,null,null,15,7