已知中序和先序|后序,建立二叉树及三种方式遍历
const int maxv= 10000+10;
int n;
int in_order[maxv],post_order[maxv],pre_order[maxv];
int lch[maxv],rch[maxv]; //左右子节点
int build1(int L1,int R1,int L2,int R2) //通过中序,后序数组建立二叉树
{
if(L1>R1) re...
转载
2018-10-04 15:57:59 ·
236 阅读 ·
0 评论