1.樹的出度=樹的入度=樹的節點數-1;n0=5,n1=3,n2未知;樹的出度=0*n0+1*n1+2*n2=n0+n1+n2-1得n2=4;故樹的總節點數爲:5+3+4=12class
2.葉子節點個數=度爲2的結點個數加1di