#include"point.h"
#include<queue>
using namespace std;
class tree
{
public:
int num;//节点个数
public:
bool tiaozheng(stnode *&first,long Number,long Mima,string Name);
void Output(stnode *&first); //output tree like this
int getlevel(stnode *&first);//树的深度
void findfirst(stnode *&first);
bool insert(stnode *&first,long Number,long Mima,string Name);
bool shanchu(stnode *&first,long Number);
void jiaohuan(stnode *& a,stnode *& b);
void free(stnode *&p);
stnode* find(stnode *&first,long Number);
};
bool tree::tiaozheng(stnode *&first,long Number,long Mima,string Name)
{
bool x,y;
stnode *p=new stnode;
stnode *s=NULL;
stnode *num1,*num2,*num3;
int al=0;
if(first==NULL)
{
s=p;
first=p;
p->mima=Mima;
p->name=Name;
p->number=Number;
}
else
{
if(Number>first->number)
{
if(first->right==NULL)
{
s=p;
first->right=p;
first->right->parent=first;
first->right->mima=Mima;
first->right->name=Name;
first->right->number=Number;
}
else
{
x=tiaozheng(first->right, Number, Mima, Name);
}
}
else if(Number<first->number)
{
if(first->left==NULL)
{
s=p;
first->left=p;
first->left->parent=first;
first->left->mima=Mima;
first->left->name=Name;