Stack A has the entries a, b, c (with a on top). Stack B is empty. An entry…

ISRO Scientist/Engineer SC · 2008 · Computer ScienceModified — slightly modified from the official paper; see the solution

Stack A has the entries a, b, c (with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B. An entry popped out of the stack B can only be printed. In this arrangement, which of the following permutations of a, b, c are not possible?

  1. A.

    b a c

  2. B.

    b c a

  3. C.

    c a b

  4. D.

    a b c

Attempted by 803 students.

Show answer

Correct answer: C

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…