以该结点为根节点的树的高度: public int height(){ return Math.max(left == null ? 0 : left.height(), right == null ? 0 : right.height()) + 1; }