Consider the following operations performed on a stack of size 5:
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?
Show answerHide answer
Correct answer: (B) Stack operations are performed smoothly
Explanation
Since the given stack size is 5 and at most two elements are on the stack at any time, and no Pop is done on an empty stack, there is no overflow or underflow. The stack operations are performed smoothly.