/*
*Copyright (c) 2015,烟台大学计算机学院
*All rights reserved.
*文件名称:erchashu.cpp
*作者:朱希康
*完成日期:2015年11月18日
*版本号:vc++6.0
*
*问题描述:二叉树解决问题
*输入描述:无
*程序输出:节点x的层数
*/
#ifndef BTREE_H_INCLUDED
#define BTREE_H_INCLUDED
#define MaxSize 100
typedef char ElemType;
typedef struct node
{
ElemType data; //数据元素
struct node *lchild; //指向左孩子
struct node *rchild; //指向右孩子
} BTNode;
void CreateBTNode(BTNode *&b,char *str); //由str串创建二叉链
BTNode *FindNode(BTNode *b,ElemType x); //返回data域为x的节点指针
BTNode *LchildNode(BTNode *p); //返回*p节点的左孩子节点指针
BTNode *RchildNode(BTNode *p); //返回*p节点的右孩子节点指针
int BTNodeDepth(BTNode *b); //求二叉树b的深度
void DispBTNode(BTNode *b); //以括号表示法输出二叉树
void DestroyBTNode(BTNode *&b); //销毁二叉树
int Nodes(BTNode *b);
void DispLeaf(BTNode *b);
int LeafNodes(BTNode *b);
int Level(BTNode *b,ElemT