Home > Back-end >  According to the first sequence and sequence have been unable to assignment of binary tree
According to the first sequence and sequence have been unable to assignment of binary tree

Time:09-25

In the process of compiling, part of the scarlet letter is displayed is not performed the assignment!!!!!! O bosses teach
Void the create (BiTree * T, char * pre, char * ino, int ps, int is, int n) {
Int I, k=1;
If (n==0)
T=NULL;
The else {
for(i=0; iIf (ino [I]==pre/ps) {
K=I;
break;
}
}
If (k==1)
T=NULL;
The else {
T=malloc (sizeof (BiTree));
T - & gt; data=https://bbs.csdn.net/topics/pre (ps),
If (k==is)
T - & gt; Lchild=NULL;
The else
Create (T - & gt; Lchild, pre, ino, ps + 1, is, k - is);
If (k==is + n - 1)
T - & gt; Rchild=NULL;
The else
Create (T - & gt; Rchild, pre, ino, ps + 1 + k - is, k + 1, n - (k - is) - 1);
}
}
}
  • Related