二叉树-已知两种遍历求第三种
1,先序和中序,输出后序#include<iostream>
#include<stack>
using namespace std;
const int N=1010;
int n,pre[N],in[N]; //先序数组和后序数组
stack<int> st; //存放父节点
void build(int l1,int r1,int l2,int ...
原创
2018-06-10 15:22:50 ·
1447 阅读 ·
1 评论