When stack is empty pop operation considered to be error - Data Structure

Q.  When is the pop operation on Stack considered to be an error?
- Published on 27 Aug 15

a. Only when the stack is empty
b. Only when the stack is full
c. When the stack is neither empty nor full
d. Cannot be predicted

ANSWER: Only when the stack is empty
 

    Discussion

  • Nirja Shah   -Posted on 18 Nov 15
    If there is no element in the stack, and you want to delete an element from it, then it will considered to be an error. While implementing the stack you must check the condition of underflow.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)