标题:怎么改呀??
取消只看楼主
想你的天空
Rank: 2
等 级:新手上路
威 望:5
帖 子:610
专家分:0
注 册:2004-12-30
 问题点数:0 回复次数:0 
怎么改呀??


#include "iostream"
#include "fstream"
#include "string"
#include "stdio.h"
using namespace std;

typedef struct BiNode{
int data;
struct BiNode *left, *right;
}BiNode, *BiTree;
void CreateBiTree(BiTree &t)
{
int number;
cin>>number;
if( number == -1 ) t = NULL;
else{
if(!(t = (BiNode *)malloc(sizeof(BiNode)))) exit(1);
t->data = number;
CreateBiTree(t->left);
CreateBiTree(t->right);
}
}
void preOrder(BiTree t)
{
if(t)
{
cout<<t->data;
if(t->left!=NULL || t->right!=NULL)
{
cout<<"(";
preOrder(t->left);
cout<<",";
preOrder(t->right);
cout<<")";
}
}
}
int main()
{
BiTree t;
CreateBiTree(t);
preOrder(t);
system("pause");
return 0;
}

搜索更多相关主题的帖子: BiNode number include int 
2005-11-05 11:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-32690-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.092634 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved