#include
#include
#include
const N=10;
typedef char elemtype;
struct bnode
{
elemtype data;
struct bnode *lchild,*rchild;
};
int top1;
int top2;
char a[20];
struct bnode* q[20];
void ...#include
#include
#include
const N=10;
typedef char elemtype;
struct bnode
{
elemtype data;
struct bnode *lchild,*rchild;
};
int top1;
int top2;
char a[20];
struct bnode* q[20];
void push(struct bnode *p,int m)
{
if(top1==N||top2==N)
coutlchild;}
p=new(bnode);
p->data=d; p->lchild=NULL; p->rchild=NULL;
if (d>q->data) q->rchild=p;
else q->lchild=p;
}
return t;
}
void last_order(struct bnode *t)
{
if (t!=NULL)
{
last_order(t->lchild);
last_order(t->rchild);
coutdata==x)
{
p=q[top1-1];
if (p->lchild->data==x) p->lchild=NULL;
if (p->rchild->data==x) p->rchild=NULL;
}
}
}
}
}
void main()
{
struct bnode *root;
char x;
// srand((unsigned)time(NULL));
root=set_tree();
cout |
|