证明:
设:节点总个数为n,叶子节点个数为:n0,度为1的节点个数为:n1,度为2的节点个数为n2,边的个数为b
n=n0+n1+n2
b=n-1; b=n1+2*n2;//来由不知,代入二叉树可得此结果
————> b=n0+n1+n2-1
n0+n1+n2-1=n1+2*n2
n0=n2+1
证明:
设:节点总个数为n,叶子节点个数为:n0,度为1的节点个数为:n1,度为2的节点个数为n2,边的个数为b
n=n0+n1+n2
b=n-1; b=n1+2*n2;//来由不知,代入二叉树可得此结果
————> b=n0+n1+n2-1
n0+n1+n2-1=n1+2*n2
n0=n2+1