文章
25
粉丝
0
获赞
210
访问
5.4k
#include<bits/stdc++.h>
using namespace std;
typedef struct node{
int data;
struct node * lchild;
struct node * rchild;
}*BitTree;
void create_tree(BitTree &T, int x){
if(T == NULL){
T = new node;
T -> data = x;
T -> lchild = NULL;
T -> rchild = NULL;
return;
}
if(x == T -> data){
return;
}else if(x < T -> data){
create_tree(T->lchild, x);
}else{
create_tree(T->rchild, x);
}
}
int main(){
int n;
while(cin >> n){
BitTree root = NULL;
for(int i = 0; i < n; i++){
&nb...
登录后发布评论
暂无评论,来抢沙发