1
2
3
4
5
6
1
2
int Push (SeqStackSeqStackSeqStack *s*s*s datatypedatatypedatatype x)x)x)
{ if s->top= =MAXLEN>top= =MAXLEN>top= =MAXLEN–1–1–1
return 0 // 0 datatype Pop SeqStack *s
else { s->top++ { datatype x;
s->data[s->top]=x>top]=x>top]=x // x if (SEmpty ( s ) )
return 1 } // 1 return 0 // 0
} else { x=s->data[s->top]
// *x
s->top - -
return x } // 1
}
3
4
typedef struct queuenode
{datatype data;
struct queuenode *next;
}queuenode; // datatype
typedef struct
{queuenode *front,*rear;