MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Consider the following operations performed on a stack of size 5:Push (a); Pop() ; Push(b); Push(c); Pop(); Push(d); Pop();Pop(); Push (e) Which of the following statements is correct?
A
Underflow occurs
B
Stack operations are performed smoothly
C
Overflow occurs
D
None of the above
Explanation: 

Detailed explanation-1: -Answer: Option A is correct. Hence, only one element is present in the stack which is 5. Thus finally only one element is is in stack i.e., 5.

Detailed explanation-2: -Detailed Solution. The correct answer is 2, 2, 1, 1, 2.

Detailed explanation-3: -Answer: The sequence of popped out values is : 2, 2, 1, 1, 2.

There is 1 question to complete.