前提须知:
Node类以及其他内容
实现代码(转载):
原版在以上链接的片末
package com.bjsxt.test;
import java.util.LinkedList;
public class DepthOfBiTree {
public int findDeep(Node root) {
int deep = 0;
if (root != null) {
int lchilddeep = findDeep(root.left);
int rchilddeep = findDeep(root.right);
deep = Math.max