正在加载图片...
f(t=nullreturn s: (s->key<f->key)f->lchild=s f->rchild=s: return t; bitree*creatordo/返回二叉树 while(x!=0) smalloc(sizeof( bitree)) s->lchild=null: t=inserts(t, s) scanf(&x) return t: bitree *root: printf("In”); destorder(root); printf("In”);else p=p->rchild; } if(t==null)return s; if(s->key<f->key)f->lchild=s; else f->rchild=s; return t; } bitree *creatord()//返回二叉树 {bitree *t, *s; int x; t=null; scanf(&x); while(x!=0) { s=malloc(sizeof(bitree)); s->data=x; s->lchild=null; s->rchild=null; t=insertbst(t,s); scanf(&x); } return t; } main() { bitree *root; printf(“\n”); root=creatord(); destorder(root); printf(“\n”); }
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有