#include"stdio.h"
#include"stdlib.h"
typedef struct node{
char data;
struct node *lchild,*rchild;
}bintnode;
typedef bintnode *bintree;
typedef struct stack
{
bintree data[100];
int tag[100];
int top;
}stack;
void push(stack *s, bintree t)
{
s->data[s->top]=t;
s->top++;
}
bintree pop(stack *s)
{
if(s->top!=0)
{
s->top--;
return (s->data[s->top]);
}
else
return NULL;
}
bintree creat()
{
char a;
bintree t;
a=getchar();
if(a=='#')
t=NULL;
else
{
t=(bintnode*)malloc(sizeof(bintnode));
t->data=a;
t->lchild=creat();
t->rchild=creat();
}
return t;
}
bintree seek(bintree t, char x)
{
bintree p;
if(t==NULL) return NULL;
else
{
if(t->data==x) return t;
else
{
p=seek(t->lchild,x);
if(p) return p;
else
return seek(t->rchild,x);
}
}
}