二叉树的建立和递归遍历

const int MAXN = 1000010;
//二叉树的节点的结构体的表示形式
struct Node
{
    char data;
    struct Node *leftchild,*rightchild;
}BTree;
//栈的结构体的表示形式
struct sstack
{
    BTree *map_stack[MAXN];
    int top;
}Stack;
//队列的结构体的表示形式
struct qqueue
{
    BTree *map_queue[MAXN];
    int head;
    int tail;
}Queue;
//创建二叉树,利用递归的方法
BTree *BuildTree()
{
    char char_str;
    printf(" %c",&char_str);
    if(char_str == '#')//"#"表示的是该树的该孩子是空的
    {
        return null;
    }
    else
    {
        BTree * Bree = (BTree*)malloc(sizeof(BTree));
        if(Bree == null)
        {
            return null;
        }
        Bree.data = char_str;
        Bree -> leftchild = BuildTree();
        Bree -> rightchild = BuildTree();
        return Bree;
    }
}
//前序遍历,递归方法实现
void Preorder(BTree *BT)
{
    if(BT == null)
    {
        return ;
    }
    printf("%c ",BT -> data);
    Preorder(BT -> leftchild);
    Preorder(BT -> rightchild);
}
//中序遍历,递归方法实现
void Inorder(BTree *BT)
{
    if(BT == null)
    {
        return ;
    }
    Inorder(BT -> leftchild);
    printf("%c ",BT -> data);
    Inorder(BT -> rightchild);
}
//后序遍历,递归方法实现
void Postorder(BTree *BT)
{
    if(BT == null)
    {
        return ;
    }
    Postorder(BT -> leftchild);
    Postorder(Bt -> rightchild);
    printf("%c ",BT -> data);
}