A - 算法与数据结构实验4:二叉树操作
根据给定的字符串生成二叉树并前序、中序、后序此二叉树。
Input
给定一字符串,其中#表示空。
例:上图输入为
HDB#A##C##G#FE###
Output
分别输出此二叉树前序、中序和后序。
Sample Input
HDB#A##C##G#FE###
Sample Output
HDBACGFE
BADCHGEF
ABCDEFGH
#include<iostream>
#include <algorithm>
#include <cstdlib>
#include<cstdio>
#include<cstring>
#include <cmath>
using namespace std;
const int M=200000+10;
const int MAX=0x3f3f3f3f;
typedef long long ll;
typedef struct node
{
char data;
struct node *l