An initially empty stack receives the elements 1, 2, 3, 4, 5 in that order,…

RSSB Computer Instructor · 2026 recruitment · Basic Computer Instructor · Paper II

An initially empty stack receives the elements 1, 2, 3, 4, 5 in that order, with each element pushed exactly once. No POP operation is permitted until at least three elements have been pushed onto the stack. Thereafter, PUSH and POP operations may be interleaved arbitrarily, subject to the LIFO property of the stack.

Which one of the following output sequences cannot be generated ?

  1. A.

    3, 2, 1, 5, 4

  2. B.

    3, 4, 5, 1, 2

  3. C.

    4, 3, 5, 2, 1

  4. D.

    5, 4, 3, 2, 1

  5. E.

    Question not attempted

Attempted by 65 students.

Sign up free to check your answer

Sign up free

Explore the full course: Rssb Senior Computer Instructor

Loading lesson…