1.

In a stack, if a user tries to remove an element from an empty stack it is called _________(a) Underflow(b) Empty collection(c) Overflow(d) Garbage CollectionThe above asked question is from Stack Operations topic in section Abstract Data Types of Data Structures & Algorithms IThis question was addressed to me in a job interview.

Answer» RIGHT choice is (a) Underflow

The best I can EXPLAIN: Underflow occurs when the user performs a pop operation on an empty STACK. Overflow occurs when the stack is full and the user performs a PUSH operation. Garbage Collection is used to recover the MEMORY occupied by objects that are no longer used.


Discussion

No Comment Found

Related InterviewSolutions