首先把本次要分析的二叉树代码放出来#_#
#include<iostream>
using namespace std;
struct tree{
int data;
tree *left,*right;
};
class Btree
{
static int n;
static int m;
public: tree *root;
Btree()
{
root =NULL;
}
void create_Btree(int);
void preOrder(tree *);//先序遍历
void inOrder(tree *);//中序遍历
void postOrder(tree *);//后序遍历
int count(tree *);//计算二叉树的个数
int findLeaf(tree *);//求二叉树叶子的个数
int findNode(tree *);//求二叉树中度数为1的结点数量
};
int Btree::n=0;
int Btree::m=0;
void Btree::create_Btree(int x){
tree *newNode = new tree;
newNode->data=x;
newNode->right=newNode->left=NULL;
if(root==NULL)
root=newNode;
else{
tree