1086 Tree Traversals Again

题目大意: 用栈的输出表示二叉树的中序遍历,要求输出二叉树的后序遍历序列。 解题思路: 题目隐含了入栈的顺序就是先序遍历的序列,根据这个构建出二叉树然后后序输出即可。 代码如下: #include<iostream> #include<cstdio> #include<fstream> #include<set> #include<cmath> #include<cstring> #include
相关文章
相关标签/搜索