
树
NotFound1
这个作者很懒,什么都没留下…
展开
-
|Tyvj|二叉树|P1441 求二叉树的先序序列
http://tyvj.cn/p/1441#include#includechar in[20], post[20];void dg(int is, int ps, int l) { char root = post[ps+l-1]; if (l==0) return ; putchar(root); int p=0; while (in[is+p]!=root && p<l原创 2016-08-06 11:19:23 · 285 阅读 · 0 评论 -
|Tyvj|NOIP2004|二叉树|P1440 FBI树
http://tyvj.cn/p/1440递归建立即可,这里把树给建立出来了不知道为什么后序遍历那里用root!=NULL不管用。。一直RE,因为是满二叉树,所以我就用层数判定了#include#includeusing namespace std;typedef struct node;typedef node* tree;struct node { tree l,r原创 2016-08-10 13:55:32 · 775 阅读 · 0 评论