Thursday, June 27, 2013

What do you mean by stack underflow and stack overflow?



The condition in which the stack is empty denoted by ‘top=-1’ is known as stack underflow.
The condition in which the stack is full denoted by ‘top=N-1’, where N is the size of the stack, is known as stack overflow.

1 comment:

  1. Stack Overflow : When the stack is full and you still try to push an element in, the condition is called stack overflow.

    Stack Underflow : When the stack is empty and an element is popped of the stack, the condition is called stack underflow.

    ReplyDelete