文章
5
粉丝
0
获赞
21
访问
636
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct node{
int data ;
struct node *lchild,*rchild;
}BitTree;
BitTree* InsertBitTree(BitTree* T,int x)
{
if(T==NULL)
{
T = (BitTree*)malloc(sizeof(BitTree));
T->data = x;
T->lchild=NULL;
T->rchild=NULL;
}
else if(x < T->data) T->lchild = InsertBitTree(T->lchild, x);
else if(x > T->data) T->rchild = InsertBitTree(T->rchild, x);
return T;
}
void PreorderTraverse(BitTree *T,char *str,int *pos)
{
if(T!=NULL)
{
str[(*pos)++]=T->data;
&...
登录后发布评论
暂无评论,来抢沙发