Question 11Asked in UGC NET Computer Science, June 2016 (Paper II & III, Selected Questions)

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?
  1. AUnderflow occurs
  2. BStack operations are performed smoothly
  3. COverflow occurs
  4. DNone of the above
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.

From UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions)

This is question 11 of UGC NET Computer Science PYQ, June 2016 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.