C语言课程设计 二叉树演示源程序.docVIP

  • 1
  • 0
  • 约4.27千字
  • 约 8页
  • 2017-12-28 发布于江西
  • 举报
C语言课程设计 二叉树演示源程序

/*二叉树演示源程序#include graphics.h #include stdio.h #include stdlib.h #include dos.h #include time.h typedef struct TREE { ?? char data;/*树的结点数据*/ ?? struct TREE *lchild; ?? struct TREE *rchild; ?? int x;/*树的x坐标*/ ?? int y;/*树的y坐标*/ }Tree; struct OUTPUT { ?? int x;/*三种遍历的x坐标*/ ?? int y;/*三种遍历的y坐标*/ ?? int num; }s; int nodeNUM=0;/*统计当前的结点数字,最多26个*/ char way;/*自动建立树和手动建立树的标志,2手动,1自动*/ char str[3];/*显示结点数据的字符串*/ void Init();/*图形初始化*/ void Close();/*图形关闭*/ Tree *CreatTree();/*文本模式下创建树的过程*/ Tree *InitTree(int h,int t,int w);/*创建树,h层次,t横坐标,w树之间的宽度,n树的建立方式*/ void DrawTree(Tree *t);/*用图形显示创建好的树*/ void Preo

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档