爱问知识人 爱问教育 医院库

如何用中序法建立一个二叉树 C语言

首页

如何用中序法建立一个二叉树 C语言


        

提交回答

全部答案

    2018-05-21 04:37:36
  •   void main( )
    {
    b_tree root=NULL;
    int i,index;
    int value;
    int nodelist[20];
    printf(" pleaase input the elements of binary tree(exit for 0 ): ");
    index=0;
    //读取数值存到数组中
    scanf("%d",&value);

    while(value!=0)
    {
    nodelist[index]=value];
    index=index 1;
    scanf("%d",&value);
    }
    //建立二叉树
    root=create_btree(nodelist,index);
    //中序遍历二叉树
    printf(" The inorder traversal result is :");
    inorder(root);
    printf(" ");
    }。
      

    我***

    2018-05-21 04:37:36

类似问题

换一换

相关推荐

正在加载...

热点检索

  • 1-20
  • 21-40
  • 41-60
  • 61-80
  • 81-100
  • 101-120
  • 121-140
  • 141-160
  • 161-180
  • 175-194
返回
顶部
帮助 意见
反馈

确定举报此问题

举报原因(必选):