![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二叉树
文章平均质量分 53
MEIdeblog
这个作者很懒,什么都没留下…
展开
-
已知先序和中序求后序
#include #include #include char str1[100],str2[100]; struct node { char data; struct node *l,*r; }; struct node *build(char *str1,char *str2,int s) { int i; struct node原创 2014-08-22 11:08:28 · 652 阅读 · 0 评论 -
错了两次,就是知先序和中序求后序的,但是不能用字符串,因为输入中间有空格,输出也有空格
#include #include #include int a[1005],b[1005]; int c[1005],s; struct node { int data; struct node *l,*r; }; struct node *build(int *a,int *b,int t) { struct node *root;原创 2014-08-23 08:50:09 · 333 阅读 · 0 评论 -
二叉树 中序,后序,叶子节点,深度
#include #include int numleaf=0; int numdepth; struct node { char data; struct node *l,*r; }; struct node *build(struct node *root) { char a; a=getchar(); if(a==',')原创 2014-08-22 09:47:43 · 624 阅读 · 0 评论 -
知道先序和中序,求后序以及层次遍历
#include #include #include char a[100000],b[100000]; struct node { char data; struct node *l,*r; }; struct node *creat(char *a,char *b,int n)//重建树 { if(原创 2014-08-27 20:58:48 · 793 阅读 · 0 评论