已知二叉树的先序遍历和中序遍历序列,输出后序遍历序列

#include <stdio.h> #include<string.h> const int N=20; char s1[N], s2[N], ans[N];//s1[N],s2[N]分别为先序和中序遍历序列 void build(int n, char* s1, char* s2, char* s) { if(n <= 0) return; int p = strchr(s2, s1[0]
相关文章
相关标签/搜索