二叉树的基本操作完整版-包含二叉树的所有操作-凡是你想要的都在里面--数据结构版.docVIP

  • 4
  • 0
  • 约2.4万字
  • 约 20页
  • 2016-11-26 发布于重庆
  • 举报

二叉树的基本操作完整版-包含二叉树的所有操作-凡是你想要的都在里面--数据结构版.doc

二叉树的基本操作完整版-包含二叉树的所有操作-凡是你想要的都在里面--数据结构版

#include stdio.h #include stdlib.h #include string.h #include math.h typedef char TElemType; //定义结点数据为字符型 typedef int Status; //定义函数类型为int型 #define ERROR 0 #define OK 1 typedef struct BiTNode{ //定义结构体 TElemType data; //结点数值 struct BiTNode *lchild; //左孩子指针 struct BiTNode *rchild; //右孩子指针 struct BiTNode *next; //下一结点指针 }BiTNode, *BiTree; Status NumJudge(char ch[20]){ //限制输入数据必须为大于零的整形 char ch1[20]; int num; while(1){ scanf(%s,ch); num=atoi(ch); //将字符串转换为整型 itoa(num,ch1,10); //将整型转换为字符串型 if(strcmp(ch,ch1)==0num0)break; else{printf(请输

文档评论(0)

1亿VIP精品文档

相关文档