没有合适的资源?快使用搜索试试~ 我知道了~
#include "stdio.h" #define datatype int int count; typedef struct bitnode { datatype data; struct bitnode *lchild,*rchild; }bitnode,*bitree; bitree bt=NULL; void find_number(bitree *t,datatype num) { if((*t)==NULL) { printf("no number %d\n",num); }
资源推荐
资源详情
资源评论
#include "stdio.h"
#define datatype int
int count;
typedef struct bitnode
{
datatype data;
struct bitnode *lchild,*rchild;
}bitnode,*bitree;
bitree bt=NULL;
void find_number(bitree *t,datatype num)
{
if((*t)==NULL)
{
printf("no number %d\n",num);
}
else
{
if((*t)->data==num)
{
printf("find the number %d\n",num);
}
else
{
if(num<(*t)->data)
find_number(&(*t)->lchild,num);
else
find_number(&(*t)->rchild,num);
}
}
#define datatype int
int count;
typedef struct bitnode
{
datatype data;
struct bitnode *lchild,*rchild;
}bitnode,*bitree;
bitree bt=NULL;
void find_number(bitree *t,datatype num)
{
if((*t)==NULL)
{
printf("no number %d\n",num);
}
else
{
if((*t)->data==num)
{
printf("find the number %d\n",num);
}
else
{
if(num<(*t)->data)
find_number(&(*t)->lchild,num);
else
find_number(&(*t)->rchild,num);
}
}
}
void insert(bitree *t,bitree new)
{
if((*t)==NULL)*t=new;
else
if(new->data==(*t)->data)
return;
else
if(new->data<(*t)->data)
insert(&(*t)->lchild,new);
else
insert(&(*t)->rchild,new);
}
void insert_num(bitree *t,datatype num)
{
bitree new;
new=(bitree)malloc(sizeof(struct bitnode));
new->data=num;
new->lchild=NULL;
new->rchild=NULL;
if((*t)==NULL)
{
(*t)=new;
printf("insert succeed over\n");
}
else
{
void insert(bitree *t,bitree new)
{
if((*t)==NULL)*t=new;
else
if(new->data==(*t)->data)
return;
else
if(new->data<(*t)->data)
insert(&(*t)->lchild,new);
else
insert(&(*t)->rchild,new);
}
void insert_num(bitree *t,datatype num)
{
bitree new;
new=(bitree)malloc(sizeof(struct bitnode));
new->data=num;
new->lchild=NULL;
new->rchild=NULL;
if((*t)==NULL)
{
(*t)=new;
printf("insert succeed over\n");
}
else
{
剩余5页未读,继续阅读
资源评论
hello__ni_hao
- 粉丝: 1
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功