Lang:G++
Edit12345678910111213141516171819202122232425262728293031// File Name: pre_in_to_post.cpp// Author: Guo Yi// Created Time: Sunday, September 07, 2014 AM06:39:21 HKT#include<iostream>using namespace std;// 由前序和中序得到后序struct BTNode{char value;BTNode *left;BTNode *right;BTNode(char v){value = v;left = right = NULL;}};BTNode *build_bt_using_pre_in(char *pre, char *in, int len){if (!pre || !in || len <= 0)return NULL;BTNode *root = new BTNode(pre[0]);int i;for (i = 0; i < len; i++){if (in[i] == pre[0])break;