poj 2255 Tree Recovery
摘要:
#include <iostream> //给出先序和中序遍历序列,输出后序遍历序列#include <string.h>using namespace std;const int MAXLEN=100;void build(int len,char* s1,char* s2,char* s) //s1,s2和s都是在不断变化,所以s1[0]...也随之不同{ if(len<=0) return; s[len-1]=s1[0]; //把根结点添加到最后 int p=strchr(s2,s1[0])-s2; //找到根结点在中序遍历... 阅读全文
posted @ 2011-07-22 14:57 sysu_mjc 阅读(113) 评论(0) 推荐(0)
浙公网安备 33010602011771号