能帮我完成一个函数吗
//已知二叉树的前序和后序,创建该二叉树
//并输出该二叉树的高和后序序列,第一行是测试数据的组数N,
//后面为N组测试数据,然后输出高度和后序排列。
#include<iostream>
#include<string.h>
using namespace std;
const int maxsize = 100;
struct tree {
char data;
tree*rchild;
tree*lchild;
};
//二叉树的创建
tree*creatBtree()
{
}
//前序
void qianxu(tree*Node)
{
if (Node == NULL)
return;
qianxu(Node->lchild);
qianxu(Node->rchild);
cout << Node->data;
}
//销毁
void xiaohui(tree*root)
{
if (root == NULL)
return;
xiaohui(root->lchild);
xiaohui(root->rchild);
delete root;
}
//主函数
int main()
{
tree*root = NULL;
int N; //组数
char qianxu[maxsize]; //前序
char zhongxu[maxsize]; //中序
cin >> N; //输入组数
cin >> qianxu>>" ">>zhongxu;//输入前序和中序的二叉树
int len = strlen(qianxu) - 1;
root = creatBtree();
xiaohui(root);
}