摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 typedef long long LL; 7 const int maxn = 30; 8 char pre[maxn], in[maxn]; 9 void Build_PostTree(char *in, char *pre, i... 阅读全文
posted @ 2016-10-24 17:32 kikii233 阅读(194) 评论(0) 推荐(0)
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 typedef long long LL; 7 const int maxn = 30; 8 char in[maxn], post[maxn]; 9 void Build_PostTree(char *in, char *post,... 阅读全文
posted @ 2016-10-24 17:31 kikii233 阅读(201) 评论(0) 推荐(0)
摘要: 题意 由前序遍历和中序遍历输出后序遍历 思路 前序遍历的第一个字母为根节点,从中序遍历中找到根节点的位置,其左边为左子树,右边为右子树,递归。 总结 从网上找了由前序遍历和中序遍历输出后序遍历 和 由中序遍历和后序遍历输出前序遍历 的代码,po在下面 不能由前序遍历和后序遍历得到中序遍历 由中序遍历 阅读全文
posted @ 2016-10-24 17:27 kikii233 阅读(121) 评论(0) 推荐(0)