二叉樹的生成與層序遍歷-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
相關文章
相關標籤/搜索