文章
70
粉丝
0
获赞
272
访问
48.9k
#include<stdio.h>
#include<iostream>
using namespace std;
typedef struct Node{
char data;
Node *lc,*rc;
}*Bitree;
void creattree(Bitree& T){
char x;
cin >> x;
if(x=='0') return;
else{
T = new Node;
T->data = x;
T->lc = NULL;
T->rc = NULL;
creattree(T->lc);
creattree(T->rc);
}
}
void visit(Node* &p){
if(p!=NULL) cout<<p->data<<" ";
}
void Preorder(Bitree &T){
if(T!=NULL){
visit(T);
&nbs...
登录后发布评论
暂无评论,来抢沙发