COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Underflow error
|
|
Overload error
|
|
Overflow error
|
|
Catastrophic error
|
Detailed explanation-1: -Overflow condition: When stack is completely full (i.e. TOP= MaxSize-1 ) and we try to insert more element onto stack then this condition is called overflow condition and no further element could be inserted now until any element is deleted.
Detailed explanation-2: -There are two possible errors that can be caused when pushing onto/popping from a stack: stack underflow-trying to pop an item from an empty stack. stack overflow-trying to push an item onto a full stack.
Detailed explanation-3: -When a stack overflow occurs, the excess data can corrupt other variables and address data, effectively changing variable values and overwriting return addresses. In some cases, this will cause the program to crash.
Detailed explanation-4: -The most-common cause of stack overflow is excessively deep or infinite recursion, in which a function calls itself so many times that the space needed to store the variables and information associated with each call is more than can fit on the stack.