int TreeDepth(BT *T);
int count=0;
void main()
{
BT *T=NULL;
char ch1,ch2,a;
ch1='y';
while(ch1=='y'||ch1=='y')
{
printf("\n");
printf("\n\t\t******************************************");
printf("\n\t\t* 1---------建 二 叉 树 *");
printf("\n\t\t* 2---------凹 入 显 示 *");
printf("\n\t\t* 3---------先 序 遍 历 *");
printf("\n\t\t* 4---------中 序 遍 历 *");
printf("\n\t\t* 5---------后 序 遍 历 *");
printf("\n\t\t* 6---------层 次 遍 历 *");
printf("\n\t\t* 7---------求 叶 子 数 *");
printf("\n\t\t* 8---------求 结 点 数 *");
printf("\n\t\t* 9---------求 树 深 度 *");
printf("\n\t\t* 0---------返 回 *");
printf("\n\t\t******************************************");
printf("\n\t\t 请选择菜单号(0--9):");
scanf("%c",&ch2);
getchar();
printf("\n");
switch(ch2)
{
case '1':
printf("\n\t\t请输入按先序建立二叉树的结点序列:\n");
printf("\n\t\t说明:'0'代表后继结点为空,请逐个输入,按回车键输入下一结点。\n");
printf("\n\t\t请输入根结点:");
T=CreateTree();
printf("\n\t\t二叉树建立成功!\n");break;
case '2':
ShowTree(T);break;
case '3':
printf("\n\t\t该二叉树的先序遍历序列为:");
Preorder(T);break;
case '4':
printf("\n\t\t该二叉树的中序遍历序列为:");
Inorder(T);break;
case '5':
湘南学院经济与管理系 信息系统课程设计 实验报告设计...胡志鹏 指导教师评阅: 指导教师(签字) 二 O 一二...数据流、数据存储、加工处理和数据结构的数 据字典...
1个接 万方数据 第3期 赵明元,胡志鹏,杨江天:...对x(I’建立一阶线性微分方程模型 学删1)(f)_...44(10):24—26.4 结构改进及试验验证针对上述分析...
由剑桥大学选用线性 低密度聚乙烯 ( L LDPE) 挤出...相关的 M CF 换热器结构还有 : ( 1) 将多张 ...参考文献: [ 1] 胡志鹏 . 塑料薄膜软包装 发展...
由剑桥大学选用线性 低密度聚乙烯 ( L LDPE) 挤出...相关的 M CF 换热器结构还有 : ( 1) 将多张 ...参考文献: [ 1] 胡志鹏 . 塑料薄膜软包装 发展...
热门文档