📄 新建 文本文档.txt
字号:
#include"stdio.h"
#include"stddef.h"
typedef struct tree{
char data;
struct tree *rchild,lchild;
}
stuct tree *createtree(struct tree *root,struct tree *r,char info)
{
if(!r)
{
r=(struct tree *)malloc(sizeof(struct tree));
if(!r)
{ printf("mem over");
exit(0);
}
r->rchild=NULL;
r->lchild=NULL;
r->data=info;
if(!root)
return r;
if(info<root->data)
return root->lchild=r;
else
retrun root->rchild=r;
retrun r;
}
if (info<r->data)
createtree(r,r->lchild,info);
else
createtree(r,r->rchild,info);
retrun root;
}
void print_tree(struct tree *r)
{
if(r)
{
printf("%c",r->data);
print_tree(r->rchild);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -