正在加载图片...
>插入一个元素的算法 数 void Insert(( Sqbt bt){ 结 int k, done=l; TElemType e; 构 while(done){ printf("In Number, dataIn) scanf(%d, %d", &k, &e); if(k<=Max Size & bt[k/2d i 树和二叉树 bt[k=e; done=0; se printf("nltERROR, input again. ) 15 创建二叉树的算法 数据结构 void CreatebT(Sqbt bt)( int nik: TElemType e; printf(" in Please Input n=; scanf(%d", &n); bt(0=1; 树和二叉树 printf("In Number, data\n); for(i=l; i<=n; i++) Insert(bt); 168 数 据 结 构 之 树 和 二 叉 树 15 ¾ 插入一个元素的算法 void Insert(SqBT bt){ int k ,done=1; TElemType e; while (done) { printf("\n Number,data\n"); scanf("%d,%d",&k,&e); if(k<=Max_Size && bt[k/2]) { bt[k]=e; done=0; } else printf("\n\tERROR, input again."); } } 数 据 结 构 之 树 和 二 叉 树 16 ¾ 创建二叉树的算法 void CreateBT(SqBT bt) { int n,i,k; TElemType e; printf("\n Please Input n="); scanf("%d",&n); bt[0]=1; printf("\n Number,data\n"); for(i=1;i<=n;i++) Insert(bt); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有