📄 11.cpp
字号:
#include <iostream>
#include "BST.h"
using namespace std;
int main()
{
bstree t1;
node *p=t1.get_root();
if(p==NULL) return 0;
cout <<"do you want to creat the leftchild?y/n";
char cha;
cin >>cha;
if(cha=='Y'||cha=='y')
{
cout <<"Please enter your data ,thank you ~:";
int dat1;
cin >>dat1;
node *n=t1.get_root();
t1.creat_trees(t1.ret_left(n),dat1);
}
cout <<"do you want to creat the rightchild?y/n";
char cha1;
cin >>cha1;
if(cha1=='Y'||cha1=='y')
{
cout <<"Please enter your data ,thank you ~:";
int dat1;
cin >>dat1;
node *n=t1.get_root();
t1.creat_trees(t1.ret_righ(n),dat1);
}
t1.mid_show();
system("pause");
int flag=0;
t1.judge(t1.get_root(),flag);
if (flag==0) cout <<"BST"<<endl;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -