Exemplo n.º 1
0
/*Constructor for the Stack Data Structure*/
struct stack *
newStack(){
    	struct stack *s = malloc(sizeof(struct stack));
	s->front = newStackNode();
	s->rear = newStackNode();
	s->size = 0;
	return s;
}
Exemplo n.º 2
0
void push(stack* st ,node* newnode)
{

	struct stacknode* temp = newStackNode(newnode) ;	
	temp->next = st->topnode ;
	st->topnode = temp ;
	st->sz += 1 ;
}