DEV Community

Discussion on: Stack Implementation in C

Collapse
 
clavinjune profile image
Clavin June

You can do this btw

//checking stack is empty or not.
int isEmpty(stack *sptr)
{
    return !sptr->top;
}
Enter fullscreen mode Exit fullscreen mode

I think you shouldn't do traverse in stack.

Collapse
 
yashdesai profile image
Yash Desai

Yes, I do agree with you. Thanks for correction!