求教高手给我解答一下该数据结构题!程序如下:
intNumOfBranchNode(BTreeT){if!Treturn-1;if!(T->lchild)||!(T->rchild){if!(T->lchild)||...
int NumOfBranchNode(BTree T)
{
if !T
return -1;
if !(T->lchild)||!(T->rchild)
{ if !(T->lchild)||(T->rchild)
return 1+NumOfBranchNode(T->rchild);
{if (T->lchild)||!(T->rchild)
return 1+NumOfBranchNode(T->lchild);
return 0;
}
else
return 1+NumOfBranchNode(T->lchild)+NumOfBranchNode(T->rchild);
} 展开
{
if !T
return -1;
if !(T->lchild)||!(T->rchild)
{ if !(T->lchild)||(T->rchild)
return 1+NumOfBranchNode(T->rchild);
{if (T->lchild)||!(T->rchild)
return 1+NumOfBranchNode(T->lchild);
return 0;
}
else
return 1+NumOfBranchNode(T->lchild)+NumOfBranchNode(T->rchild);
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询