MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Pushing an element into stack already having five elements and stack size of 5, then stack becomes
A
Overflow
B
Crash
C
Underflow
D
None of the above
Explanation: 

Detailed explanation-1: -Explanation: The stack is filled with 5 elements and pushing one more element causes a stack overflow. This results in overwriting memory, code and loss of unsaved work on the computer.

Detailed explanation-2: -Answer: Its called stack overflow.

Detailed explanation-3: -A stack overflow is a type of buffer overflow error that occurs when a computer program tries to use more memory space in the call stack than has been allocated to that stack.

Detailed explanation-4: -In a stack, if a user tries to remove an element from the empty stack then it is called as underflow.

Detailed explanation-5: -PUSH: The process of adding (or inserting) a new element to the top of the stack is called PUSH operation. Pushing an element to a stack will add the new element at the top. After every push operation the top is incremented by one.

There is 1 question to complete.