Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct
- {
- int top;
- int items[100];
- } Stack;
- void initialize(Stack *s)
- {
- s->top=0;
- }
- void push(Stack *s,int value)
- {
- s->items[s->top++]=value;
- }
- int pop(Stack *s)
- {
- return s->items[--s->top];
- }
- int isfull(Stack *s)
- {
- return s->top<100?0:1 ;
- }
- int isempty(Stack *s)
- {
- return s->top==0?1:0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement