摘要: 今天只水了一道二叉树重建,本来白书上是有代码的,可惜我的白书锁教室了,只好自己想了一下,还算可以。 1 #include <stdio.h> 2 #include <string.h> 3 int cnt; 4 char c[30]; 5 void build(char * s,char * t,int l) 6 { 7 if(l == 1) 8 {c[cnt++] = *s; return ;} 9 int n = strchr(t,s[0]) - t;10 if(n) build(s+1,t,n);11 if(l-n-1)12 bui... 阅读全文