#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
typedef struct BiNode{
struct BiNode *left;
struct BiNode * right;
int num;
}BiNode,*BiTree;
BiTree tt;
int b[500];
//建树
void createTree(BiTree* root,int key)
{
//cout<<key;
BiTree t;
t = (BiTree)malloc(sizeof(BiNode));
t->left = NULL;
t->right = NULL;
t->num = key;
if(*root == NULL)
{
*root = t;
return;
}
if((*root)->left==NULL&&(*root)->num>key)
{
(*root)->left = t;
return;
}
if((*root)->right==NULL&&(*root)->num<key)
{
(*root)->right = t;
return;
}
if((*root)->num>key)
{
createTree(&(*root)->left,key);
return;
}
else if((*root)->num<key)
{
createTree(&(*root)->right,key);
return;
}
else
return;
}
//前序