#include
#include
struct node;
typedef struct node *pnode;
struct node
{
char info;
pnode link;
};
struct linkstack
{
pnode top;
};
typedef struct linkstack *plinkstack;
plinkstack createnullstack()
{
plinkstack plstack;
plstack=(plinkstack)malloc(sizeof(struct linkstack));
if(plstack!=NULL)
{
plstack->top=NULL;
}
else printf("空栈建立失败\n");
return plstack;
}
int isnullstack(plinkstack plstack)
{
return (plstack->top==NULL);
}
void push_stack(plinkstack plstack,char x)
{
pnode p;
p=(pnode)malloc(sizeof(struct node));
if(p==NULL)
{
printf("进栈