Suppose we push the characters A, B, C, D (in this order) into a stack and…

Suppose we push the characters A, B, C, D (in this order) into a stack and then pop 4 times. Which of the following is not a possible output sequence?

  1. A.

    DCBA

  2. B.

    CDBA

  3. C.

    CABD

  4. D.

    ABDC

Attempted by 681 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…