怎么求二叉树的结点数,并返回结点数。下面的程序错在哪啊???求助啊!!!
怎么求二叉树的结点数,并返回结点数。下面的程序错在哪啊???求助啊!!!#include "stdafx.h"
#include "stdlib.h"
typedef int ElemType;
struct BTreeNode{
ElemType data;
struct BTreeNode *left,*right;
};
int BTreeCount(struct BTreeNode* BT)
{ int n=0,m=0;
if(BT=NULL)
return (0);
else
{
BTreeCount(BT->left );
n++;
BTreeCount(BT->right);
m++;
return (n+m);
}
}