← 返回 amazon 的题目列表Calculate Maximum Depth of a Binary Tree with Complexity Analysis
类型:online_judge
amazon
Given a binary tree, write an algorithm to return its depth. Depth is defined as the number of nodes along the longest path from the root node to the farthest leaf node. Provide the complexity analysis of your algorithm and at least three test cases.
Example
Input
None