by Darren · May 23, 2014 1. Problem Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 2. Idea The maximum depth of a tree can be recursively defined. That is, it is the larger of the maximum depth of its left subtree and that of its right subtree, plus 1. 3. Implementation Java package me.darrensunny.leetcode; /** * LeetCode - Maximum Depth of Binary Tree * Created by Darren on 14-5-23.
Read full article from LeetCode - Maximum Depth of Binary Tree | Darren's Blog