#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int flag;
struct btree
{
int date;
btree *left, *right;
};
void creathead(btree *&root)
{
root = new btree;
cin >> root->date;
root->left = root->right = NULL;
}
void creatbtree(btree *& root,int insert)
{
if (root == NULL)
{
root = new btree;
root->date = insert;
root->left = root->right = NULL;
#include<stdio.h>
#include<string>
using namespace std;
int flag;
struct btree
{
int date;
btree *left, *right;
};
void creathead(btree *&root)
{
root = new btree;
cin >> root->date;
root->left = root->right = NULL;
}
void creatbtree(btree *& root,int insert)
{
if (root == NULL)
{
root = new btree;
root->date = insert;
root->left = root->right = NULL;