A program attempts to generate as many permutations as possible of the string,…

GATE · 2004 · IT

A program attempts to generate as many permutations as possible of the string, 'abcd' by pushing the characters a, b, c, d in the same order onto a stack, but it may pop off the top character at any time. Which one of the following strings CANNOT be generated using this program?

  1. A.

    abcd

  2. B.

    dcba

  3. C.

    cbad

  4. D.

    cabd

Attempted by 1141 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…