Professional KnowledgeHardIBPS SO IT

A stack permutation: pushes 1, 2, 3, 4 in order. Which output sequence is impossible?

  1. A. 2, 1, 4, 3
  2. B. 3, 1, 2, 4
  3. C. 1, 2, 3, 4
  4. D. 4, 3, 2, 1

Correct answer: B. 3, 1, 2, 4

To output 3 first, 1 and 2 are on the stack with 2 on top, so 2 must come before 1.

More IT Officer Professional Knowledge (IBPS SO) questions

Exams that ask this topic