1 2 3

int push (int item, Nodeptr*top)

{

Nodeptrnp;

np = (
Nodeptr) malloc (sizeof (Node));

if (np == NULL)

return
STACKFULL;

int pop (Nodeptr*top) {

Nodeptrnp;

else {


} ;

int item;

if (*top != NULL) {

np->data = item;

np->next = *top;

*top = np;

item = (*top)->data;

np = *top;

*top = (*top)->next;

free (np);

return item;

return OK;

}

};

return
STACKEMPTY;

}

[CONVERTED BY MYRMIDON]