1138 Postorder Traversal(先序+中序=二叉树)

大致题意就是给出一个二叉树的先序、中序遍历序列,要求输出二叉树后序遍历的第一个元素。 1 #include<iostream> 2 using namespace std; 3 4 const int maxn = 50010; 5 int n,pre[maxn],in[maxn],flag = 1
posted @ 2020-03-15 12:08  tangq123  阅读(150)  评论(0编辑  收藏  举报