二叉树的生成与层序遍历-PAT A1020

题目要求是:给出一棵二叉树的后序遍历序列和中序遍历序列,求这棵二叉树的层序遍历序列。 #include <cstdio> #include <queue> using namespace std; const int maxn = 35; int post[maxn] = {0}; int in[maxn] = {0}; int traversal[maxn] = {0}; int N; st
相关文章
相关标签/搜索