
树
iroy33
这个作者很懒,什么都没留下…
展开
-
PAT (Advanced Level) Practice 1020 Tree Traversals (25 point(s))+GPLT 玩转二叉树
题意:给出一棵二叉树的后序遍历序列和中序遍历序列,求这棵二叉树的层次遍历序列 #include<cstdio> #include<cstring> #include<queue> using namespace std; struct node { int data; node *lch; node *rch; }; const in...原创 2019-03-27 16:24:21 · 142 阅读 · 0 评论 -
L3-010 是否是完全二叉搜索树
涉及到完全二叉树的时候还是用数组比较好鸭,root的左儿子是2*root, root的右儿子是2*root+1 如果用指针建树,好像不太好判断是否是完全二叉树 #include<iostream> using namespace std; const int N=100; int num[N]; int maxx=0; int n; int main() { cin>...原创 2019-03-28 20:56:19 · 129 阅读 · 0 评论